Web Server Configuration
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsWeb DesignWeb Server Configuration

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 6th, 2011, 01:07 PM
wangi80 wangi80 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2011
Posts: 1 wangi80 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 m 12 sec
Reputation Power: 0
Redirect MSIE browse + ES and DE traffic

Hello,

This is my first post in Devarticles. I need help with something. Please help. I'm a amateur regarding htaccess,
so please bear with me as I try to explain what I need done.

I want to redirect all versions of IE browsers from one page to another internal page (not 301 redirect),
and also redirect all Spanish and German traffic/users to the same respective pages.
I have 4 specific pages that I need to do this on.

I did get some help over at webmasterworld.com/apache/ , but the problem is that the main guy running
that forum has a hectic time in life and can't support the forum as much any more. So, here's what I got:

Code:
# 302 Redirect MSIE requests for all .htm pages except for NEW.htm itself to NEW.htm
RewriteCond %{REQUEST_URI} !^/NEW\.htm$
RewriteCond %{HTTP_USER_AGENT} ^([^\ ]+\ )+MSIE\ [0-9]+\.
RewriteRule \.htm$ http://www.example.com/NEW.htm [R=302,L]
#
# 302 Redirect requests having German or Spanish as the FIRST language
# preference for any of these four specific pages to NEW.htm
RewriteCond %{HTTP:Accept-Language} ^(de|es)([,;\-].+)?$ [NC]
RewriteRule ^(PAGE1|PAGE2|PAGE3|PAGE4)\.htm$ http://www.example.com/NEW.htm [R=302,L]


Regarding the first code - Redirecting MSIE users:

The first part of this code redirect all MSIE users that arrive in this directory to NEW.htm

The problem here is that I have a lot of other pages in the directory, and I don't want all these pages to be effected.
Only 4 of them. And these 4 should redirect (ONLY for MSIE users) to a similar page but different.

I want it done like this:
page1.htm to be redirected to page1.new.htm
page2.htm to be redirected to page2.new.htm
page3.htm to be redirected to page3.new.htm
page4.htm to be redirected to page4.new.htm

Regarding the second code - Redirecting ES and DE users:

The second part of this code redirect all ES and DE users that arrive at page1.htm, page2.htm, page3.htm and page4.htm in this directory to NEW.htm

But I want them to be redirected like this:
page1.htm to be redirected to page1.new.htm
page2.htm to be redirected to page2.new.htm
page3.htm to be redirected to page3.new.htm
page4.htm to be redirected to page4.new.htm

.................................................

I was told that the command "RewriteCond" only applies to the next line, so I asked:

"Because the RewriteCond only applies to the first RewriteRule should I put in 4 RewriteCond lines,
and get rid of the {REQUEST_URI} line at the top since not all are going to get redirected to the same page?"

Code:
RewriteCond %{HTTP_USER_AGENT} ^([^\ ]+\ )+MSIE\ [0-9]+\.
RewriteRule ^(PAGE1)\.htm$ http://www.example.com/page1.new.htm [R=302,L]
RewriteCond %{HTTP_USER_AGENT} ^([^\ ]+\ )+MSIE\ [0-9]+\.
RewriteRule ^(PAGE2)\.htm$ http://www.example.com/page2.new.htm [R=302,L]
RewriteCond %{HTTP_USER_AGENT} ^([^\ ]+\ )+MSIE\ [0-9]+\.
RewriteRule ^(PAGE3)\.htm$ http://www.example.com/page3.new.htm [R=302,L]
RewriteCond %{HTTP_USER_AGENT} ^([^\ ]+\ )+MSIE\ [0-9]+\.
RewriteRule ^(PAGE4)\.htm$ http://www.example.com/page4.new.htm [R=302,L] 


... but I did not get any clear answer to this.

And I also asked regarding the second code:
"And the same goes for the {HTTP:Accept-Language} code, redirecting Spanish and German browsers as follows:"

Code:
RewriteCond %{HTTP:Accept-Language} ^(de|es)([,;\-].+)?$ [NC]
RewriteRule ^(PAGE1)\.htm$ http://www.example.com/page1.new.htm [R=302,L]
RewriteCond %{HTTP:Accept-Language} ^(de|es)([,;\-].+)?$ [NC]
RewriteRule ^(PAGE2)\.htm$ http://www.example.com/page2.new.htm [R=302,L]
RewriteCond %{HTTP:Accept-Language} ^(de|es)([,;\-].+)?$ [NC]
RewriteRule ^(PAGE3)\.htm$ http://www.example.com/page3.new.htm [R=302,L]
RewriteCond %{HTTP:Accept-Language} ^(de|es)([,;\-].+)?$ [NC]
RewriteRule ^(PAGE4)\.htm$ http://www.example.com/page4.new.htm [R=302,L] 


... but I did not get any clear answer to this either.

Can someone in here please help?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsWeb DesignWeb Server Configuration > Redirect MSIE browse + ES and DE traffic


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap