Last active
August 29, 2015 14:15
-
-
Save cesardraw2/75086179e16044430be6 to your computer and use it in GitHub Desktop.
Como Redirecionar uma URL de acordo com o Browser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# As vezes precisamos fazer redirects específicos de acordo com o browser | |
# Por exemplo: http://cesardraw.com.br/babu | |
<ifModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{HTTP_USER_AGENT} Opera | |
RewriteRule ^babu$ /babu_opera [NC,L] | |
RewriteCond %{HTTP_USER_AGENT} MSIE | |
RewriteRule ^babu$ /babu_ie [NC,L] | |
RewriteCond %{HTTP_USER_AGENT} Chrome | |
RewriteRule ^babu$ /babu_chrome [NC,L] | |
RewriteCond %{HTTP_USER_AGENT} Safari | |
RewriteRule ^babu$ /babu_safari [NC,L] | |
RewriteCond %{HTTP_USER_AGENT} Firefox | |
RewriteRule ^babu$ /babu_firefox [NC,L] | |
# Se o browser não atender nenhuma das condições acima | |
RewriteRule ^babu$ /babu_default [L] | |
</ifModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment