.htaccess - Too many redirects on mobile devices (iOS, android) -
i'am trying understand while now, why rewrite rules in .htaccess file give me error. happens on mobile devices (ios , android), works fine on desktop browsers. error many redirects. i'm trying 301 redirect http traffic https. here code:
<ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewritecond %{http_host} ^(www\.)?example\.com$ [nc] rewritecond %{https} !on$ [or] rewritecond %{http_host} !^www\..+$ [nc] rewriterule ^(.*)$ https://www.example.com%{request_uri} [r=301,l,ne] rewriterule ^(.*/)?\.(git|svn|hg|bzr)+ - [r=404,l] rewritecond %{request_filename} -f [or] rewritecond %{request_filename} -s [or] rewritecond %{request_filename} -l [or] rewritecond %{request_filename} -d rewriterule ^.*$ - [nc,l,qsa] rewriterule ^(.*)$ index.php [nc,l,qsa]
any appreciated :)
try changing rewritecond %{https} !on$ [or]
rewritecond %{https} off [or]
Comments
Post a Comment