homepage Welcome to WebmasterWorld Guest from 54.198.157.6
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Help with htaccess redirect only for MSIE 5 and 6
Vishal




msg:3975173
 7:03 pm on Aug 19, 2009 (gmt 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.

 

g1smd




msg:3975191
 7:30 pm on Aug 19, 2009 (gmt 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.

Vishal




msg:3975239
 8:48 pm on Aug 19, 2009 (gmt 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.

jdMorgan




msg:3975412
 4:26 am on Aug 20, 2009 (gmt 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

Vishal




msg:3975850
 6:13 pm on Aug 20, 2009 (gmt 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.

jdMorgan




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

Do you have any other working RewriteRules?

If not, add
Options +FollowSymLinks
ahead of "RewriteEngine on" and see if that helps.

Jim

Vishal




msg:3976693
 2:49 am on Aug 22, 2009 (gmt 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. :)

StoutFiles




msg:3976710
 5:29 am on Aug 22, 2009 (gmt 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.

jdMorgan




msg:3976814
 1:56 pm on Aug 22, 2009 (gmt 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

Vishal




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

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved