.htaccess - htaccess set http on all pages except login page -


i used example stack post force http on site pages except user login page. don't know if missing anything, did not work:

# turn ssl on login rewritecond %{https} off rewritecond %{request_uri} ^customer/login/ [nc] rewriterule ^(.*)$ https://%{http_host}/$1 [r=301,l]  # turn ssl off login rewritecond %{https} on rewritecond %{request_uri} !^customer/login/ [nc] rewriterule ^(.*)$ http://%{http_host}/$1 [r=301,l] 

that looks should work, reason isn't. can please let me know missing. thank you.

request_uri requires leading slash. have it, not match. try rules way.

# turn ssl on login rewritecond %{https} off rewritecond %{request_uri} ^/customer/login/ [nc] rewriterule ^(.*)$ https://%{http_host}/$1 [r=301,l]  # turn ssl off login rewritecond %{https} on rewritecond %{request_uri} !^/customer/login/ [nc] rewriterule ^(.*)$ http://%{http_host}/$1 [r=301,l] 

Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -