سؤال

I'm currently trying to set up my website to redirect when viewed on IE7 or below. I've set up a htaccess redirect that will redirect to another page in the website on the occasion that it is accessed with the IE browser.

It seems to trap itself in an infinite loop because it redirect when redirected to the webpage. Below is the code I use:

RewriteCond %{HTTP_USER_AGENT} "MSIE [2-7]" [NC]
RewriteRule ^(.*)$ http://www.domain.com/old-browser.php [R=301,L]

Is there some additional detail I need to add to prevent the redirect to not be acted upon when accessing that particular page?

Thanks for your support.

هل كانت مفيدة؟

المحلول

Check that your not already on that script, add the line below either above or below your current condition (definitely above the rewrite rule!)

RewriteCond %{REQUEST_FILENAME} !old-browser\.php$
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top