Forum Moderators: phranque
# Redirect all users that use the browser MSIE from one htm file to another
RewriteCond %{HTTP_USER_AGENT} .*MSIE.*
RewriteRule ^(PAGE1.htm)$ http://example.com/NEW.htm [R,NC,L]
RewriteRule ^(PAGE2.htm)$ http://example.com/NEW.htm [R,NC,L]
RewriteRule ^(PAGE3.htm)$ http://example.com/NEW.htm [R,NC,L]
RewriteRule ^(PAGE4.htm)$ http://example.com/NEW.htm [R,NC,L]
# Redirect Spanish and German users
RewriteCond %{HTTP:Accept-Language} (de|es) [NC]
RewriteRule ^(PAGE1.htm)$ http://example.com/NEW.htm [R,L]
RewriteRule ^(PAGE2.htm)$ http://example.com/NEW.htm [R,L]
RewriteRule ^(PAGE3.htm)$ http://example.com/NEW.htm [R,L]
RewriteRule ^(PAGE4.htm)$ http://example.com/NEW.htm [R,L]
Or I could put in NC at the end (not sure why? Does NC mean chase sensitive?):
RewriteCond %{HTTP:Accept-Language} (de|es) [NC]
RewriteRule ^(PAGE1.htm)$ http://example.com/NEW.htm [R,NC,L]
RewriteRule ^(PAGE2.htm)$ http://example.com/NEW.htm [R,NC,L]
RewriteRule ^(PAGE3.htm)$ http://example.com/NEW.htm [R,NC,L]
RewriteRule ^(PAGE4.htm)$ http://example.com/NEW.htm [R,NC,L]
# Not really sure what this is for
RewriteCond %{HTTP_HOST} (de|es)
RewriteRule ^(PAGE1.htm)$ http://example.com/NEW.htm [R,L]
RewriteRule ^(PAGE2.htm)$ http://example.com/NEW.htm [R,L]
RewriteRule ^(PAGE3.htm)$ http://example.com/NEW.htm [R,L]
RewriteRule ^(PAGE4.htm)$ http://example.com/NEW.htm [R,L]
Or should this one as well have the NC at the end?
RewriteRule ^(PAGE1.htm)$ http://example.com/NEW.htm [R,NC,L]
RewriteRule ^(PAGE2.htm)$ http://example.com/NEW.htm [R,NC,L]
RewriteRule ^(PAGE3.htm)$ http://example.com/NEW.htm [R,NC,L]
RewriteRule ^(PAGE4.htm)$ http://example.com/NEW.htm [R,NC,L]
# 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]
But I have a question regarding the MSIE redirection part as well.
I have several other htm files in that folder. And I don't want MSIE users who arrive at these files to be redirected to NEW.htm, only the ones that land on PAGE 1 2 3 4 ... I only want thous 4 pages to be affected.
# preference for any of these four specific pages to NEW.htm
RewriteRule ^(PAGE1|PAGE2|PAGE3|PAGE4)\.htm$
the above statement implies that English is NOT this person's primary language
HTTP_ACCEPT_LANGUAGE=iu,en-US;q=0.9,en;q=0.8,nb;q=0.7,nn;q=0.6,de;q=0.5 ... et cetera Someone else will come along and tell you if it is safe to combine this with a SetEnvIf and %{ENV:blahblah} so you don't have to say the same thing five times in a row.
jdMorgan (Jim) is the expert here. His absence since late October has literally brought this forum to a halt.
Others (such as myself) are simply attempting to fill in the void and assist Jim during a period of which he has little time.