Welcome to WebmasterWorld Guest from 50.17.117.221

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Help with htaccess redirect only for MSIE 5 and 6

     
7:03 pm on Aug 19, 2009 (gmt 0)

Full Member

10+ Year Member

joined:Dec 7, 2000
posts: 267
votes: 0


I can't figure out on how to fix the issue.

I am almost done giving finishing touches to a major site & even though it looks as it should on all latest browsers (IE 7, 8, most FF's, Opera, Safari), however my good friend confirmed that it looks pretty silly in IE6, as it happens to break some of the css code.

So instead of redesigning whole site to fit IE6 and punishing those who upgrade their browsers, I am wanting to setup different lower grade version for IE6.

So someone please tell me how can I fix the below code, so it will redirect

RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^.*MSIE 6.*
RewriteRule /* [ie6.domain.com...]

Thanks for the help.

7:30 pm on Aug 19, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


You really should not maintain two sites. That's a whole load of extra unnecessary work, and a Duplicate Content problem.

The usual fix is to have a conditional link to a CSS file that has the IE fixes in, that file only being 'seen' by IE6 users.

8:48 pm on Aug 19, 2009 (gmt 0)

Full Member

10+ Year Member

joined:Dec 7, 2000
posts:267
votes: 0


I understand that I can use below condition to display different style for IE6
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="ie6.css" />
<![endif]-->

However it will be a real nightmare to touch existing design or make changes just for IE6. Instead I am already having a little older working theme (different colors and layout though) with most of the features. Since main and redirect sites will be using information from same database users to both places will see same information, however IE6 users will still get a working site (though with little less features). Know what I mean? I also plan to setup a nice info bar on top requesting them to upgrade their browser.

Thanks.

4:26 am on Aug 20, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0



RewriteEngine on
#
# Redirect IE 5 and IE 6 requests to version-specific subdomains
RewriteCond %{HTTP_USER_AGENT} MSIE\ ([56])\.
RewriteRule ^(.*)$ http://www.ie%1.domain.com/$1 [R=302,L]

Jim
6:13 pm on Aug 20, 2009 (gmt 0)

Full Member

10+ Year Member

joined:Dec 7, 2000
posts:267
votes: 0


Hi Jim,

Thanks for the code, however for some reason it does not seem to work. It is not redirecting at all and keeping me on the original page.

Here is the current htaccess file

AddType text/html .html
AddHandler server-parsed .html
AddHandler server-parsed .htm

RewriteEngine on
#
# Redirect IE 5 and IE 6 requests to version-specific subdomains
RewriteCond %{HTTP_USER_AGENT} MSIE\ ([56])\.
RewriteRule ^(.*)$ [myredirecturllocation.com...] [R=302,L]

Any idea on what might be wrong?

Thanks.

8:28 pm on Aug 20, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


Do you have any other working RewriteRules?

If not, add

 Options +FollowSymLinks

ahead of "RewriteEngine on" and see if that helps.

Jim

2:49 am on Aug 22, 2009 (gmt 0)

Full Member

10+ Year Member

joined:Dec 7, 2000
posts:267
votes: 0


Hi Jim,

No there is no other rewrites on this site. In addition, since I am testing it on demo site, I cleared up all other info in htaccess and was testing with only required info.

Options +FollowSymLinks
ahead of "RewriteEngine on" and see if that helps.

Worked like a charm and did the trick.

Thanks a lot. :)

5:29 am on Aug 22, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:May 6, 2008
posts:2011
votes: 0


On your IE6 site I would make sure to put a no-index metatag on the pages so that you avoid any possible duplicate content problems.
1:56 pm on Aug 22, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


Yes, I'd suggest a complimentary rule that 301-redirects non-IE5/6 requests for "myredirectlocation/com" back to the main site, so that IE8, Mozilla, Opera, and search engines are always redirected away from the special IE5/6 URLs.

Jim

2:31 pm on Aug 22, 2009 (gmt 0)

Full Member

10+ Year Member

joined:Dec 7, 2000
posts:267
votes: 0


Thanks for the tip, I will make sure that I use both redirect and noindex tag for IE6 version.