apache - htaccess rewrite condition not working in internet explorer -
we have mutiple websites same code. problem working correctly in firefox, chrome etc, not working in ie.
my suggestion internet explorer sends different/incorrect http_host. can't figure out why. can me in right direction. have posted htaccess file below
what code should do: 1. check if request sitemap 2. redirect www http 3. if website not website.nl use http 4. if website website.nl use https 5. use request request.php file
rewriteengine on rewritebase / rewriterule ^sitemap\.xml/?$ generate_sitemap.php [nc,l] rewritecond %{http_host} ^www\.(.*)$ [nc] rewriterule ^(.*)$ http://%1/$1 [r=301,l] rewritecond %{http_host} !^(www\.)?website.nl$ [nc] rewritecond %{http_host} ^$ rewriterule ^(.*)$ http://%{http_host}%{request_uri} [r=301,l] rewritecond %{http_host} ^(www\.)?website.nl$ [nc] rewritecond %{https} !=on rewriterule ^(.*)$ https://%{http_host}%{request_uri} [r=301,l] rewritecond %{request_filename} !-f rewriterule ^((.|/)*)$ /request.php?path=$1 [qsa,l]
it's unlikely internet explorer sends host
header chrome , firefox. you're seeing internet explorer has old , wrong rewrite rule cached (you're using 301
permanent redirects, cached in browser). chrome , firefox have old rule cached.
clear browser cache or use private/incognito mode , try again.
i can recommend using 302
temporary redirects until have verified rules working properly.
if above solve issue:
you can test rewrite rules here: http://htaccess.madewithlove.be
you can view request headers, including host
header, in internet explorer's developer console pressing f12 / networking view.
also check internet explorer's , modem/router settings verify you're not accidentally using proxy.
Comments
Post a Comment