Redirect IE 6, 7 and 8 users with htaccess

2019-03-14 05:20发布

问题:

How can I redirect users for IE versions 6-8 with htaccess to a certain directory (mysite.com/ie)?

Note: I am using Wordpress.

回答1:

something like:

RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} "MSIE [6-8]" [NC]
RewriteRule ^(.*)$ http://mysite.com/ie [R=301,L]


回答2:

It is much more simple to handle this with a simple javascript function. You can also use HTML. Here's a sample of javascript that detects the browser version. You should be able to tailor this to suit your needs:

Detecting Windows Internet Explorer More Effectively