WordPress.org

Support

Support » Multisite » Redirect IE6 users – .htaccess

Redirect IE6 users – .htaccess

  • Hey 🙂

    I am trying to redirect IE 6 users to a static page (namely upgrade.php in my site root), i have added the following code to my .htaccess file :

    RewriteCond %{HTTP_USER_AGENT} "MSIE 6"
    RewriteRule (.*) /upgrade.php [L,R=301]

    the above code works and will forward visitors using IE 6 to the page, however i get an error “Too many redirects”.

    Any ideas?

    Thx,

    AB24

Viewing 5 replies - 1 through 5 (of 5 total)
  • Where did you add the code? Is it at the top of your .htaccess file or at the bottom?

    Also put in the FULL path http://domain.com/upgrade.php

    Hey, thanks for your replies 🙂

    @curtiss : it is near the top, just after the code below :

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]

    could this be overriding the original redirect to upgrade.php? giving me an infinite loop?

    @ipstenu good point, I will add this tomorrow when i return to work.

    In the mean time i have been googling the problem and found this.

    I noted on the last line, {the rewrite rule} the author took out the (.*) and replaced it with just a . {period} as below :

    RewriteRule . upgrade.html [L]

    so tomorrow i will try the code below and report my findings

    RewriteCond %{HTTP_USER_AGENT} "MSIE 6"
    RewriteRule . http://myDomain.com/upgrade.php [L,R=301]

    🙂

    Put it at the ABSOLUTE top. Above the WordPress stuff.

    RewriteCond %{HTTP_USER_AGENT} "MSIE 6"
    RewriteRule (.*) http://myDomain.com/upgrade.php
    
    # Begin WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    ....

    ETA: I wouldn’t put the 301 stuff in there, since you don’t really need that except for Google, and Google don’t use IE 6 😉

    Thanks once again 🙂

    I will try this out tomorrow morning.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Redirect IE6 users – .htaccess’ is closed to new replies.