WordPress.org

Ready to get started?Download WordPress

Forums

Redirect IE6 users - .htaccess (6 posts)

  1. AB24
    Member
    Posted 2 years ago #

    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

  2. Curtiss Grymala
    Member
    Posted 2 years ago #

    Where did you add the code? Is it at the top of your .htaccess file or at the bottom?

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

  4. AB24
    Member
    Posted 2 years ago #

    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]

    :)

  5. 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 ;)

  6. AB24
    Member
    Posted 2 years ago #

    Thanks once again :)

    I will try this out tomorrow morning.

Topic Closed

This topic has been closed to new replies.

About this Topic