Redirect a visitor to different pages depending on his browser

By | August 26, 2009

If you need to redirect users depending on their web browser, you can use this:

RewriteCond  %{HTTP_USER_AGENT}  ^Mozilla.*
RewriteRule  ^/$                 /homepage.max.html  [R=301,L]
RewriteCond  %{HTTP_USER_AGENT}  ^Lynx.*
RewriteRule  ^/$                 /homepage.min.html  [R=301,L]
RewriteRule  ^/$                 /homepage.std.html  [R=301,L]
RewriteCond  %{HTTP_USER_AGENT}  ^Mozilla.*
RewriteRule  ^/$                 /homepage.max.html  [R=301,L]
RewriteCond  %{HTTP_USER_AGENT}  ^Lynx.*
RewriteRule  ^/$                 /homepage.min.html  [R=301,L]
RewriteRule  ^/$                 /homepage.std.html  [R=301,L]

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.