Posted By

nathansearles on 11/24/10


Tagged

redirect htaccess mobile


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

superman
seanpowell


htaccess mobile redirect


 / Published in: Apache
 

  1. #redirect mobile browsers
  2. RewriteCond %{HTTP_USER_AGENT} ^.*iPhone.*$
  3. RewriteRule ^(.*)$ http://m.example.com [R=301]
  4. RewriteCond %{HTTP_USER_AGENT} ^.*iPad.*$
  5. RewriteRule ^(.*)$ http://m.example.com [R=301]
  6. RewriteCond %{HTTP_USER_AGENT} ^.*Android.*$
  7. RewriteRule ^(.*)$ http://m.example.com [R=301]
  8. RewriteCond %{HTTP_USER_AGENT} ^.*BlackBerry.*$
  9. RewriteRule ^(.*)$ http://blackberry.example.com [R=301]
  10. RewriteCond %{HTTP_USER_AGENT} ^.*IEMobile.*$
  11. RewriteRule ^(.*)$ http://ie.example.com [R=301]

Report this snippet  

You need to login to post a comment.