.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
Post a Comment