php - Http to https redirect not working for few pages -
following htaccess code working on home page. when enter my.example.com
in url, htaccess redirects https://my.example.com
when enter my.example.com/login
, it's not redirecting https://my.example.com/login
(i don't want www in domain name)
<ifmodule mod_rewrite.c> rewriteengine on options +followsymlinks rewritebase / rewriterule ^$ app/webroot/ [l] rewriterule (.*) app/webroot/$1 [l] rewritecond %{http_host} ^[^.]+\.[^.]+$ rewritecond %{https}s ^on(s)| rewriterule ^https://%{http_host}%{request_uri} [l,r=301] </ifmodule>
please let me know going wrong? thanks
keep redirect rule before internal rewrite ones , fix syntax error in http->https error:
rewriteengine on options +followsymlinks rewritebase / rewritecond %{https} off rewriterule ^ https://%{http_host}%{request_uri} [l,ne,r=301] rewriterule (.*) app/webroot/$1 [l]
Comments
Post a Comment