Is it possible to detect iPhone browser agent in .htaccess and redirect the user to the correct iPhone page?
+1
A:
A little Googling, even has a handy generator. http://detectmobilebrowsers.mobi/
madjester
2010-07-07 16:30:55
+3
A:
Sure you can -
#redirect mobile browsers
RewriteCond %{HTTP_USER_AGENT} ^.*iPhone.*$
RewriteRule ^(.*)$ http://mobile.yourdomain.com [R=301]
RewriteCond %{HTTP_USER_AGENT} ^.*BlackBerry.*$
RewriteRule ^(.*)$ http://mobile.yourdomain.com [R=301]
RewriteCond %{HTTP_USER_AGENT} ^.*Palm.*$
RewriteRule ^(.*)$ http://mobile.yourdomain.com [R=301]
Taken from here
Tommy
2010-07-07 16:30:55
GREAT! thanks tommy!
K001
2010-07-08 12:57:14
A:
To add to @Tommy's response, if you want to pass through the URI, change the RewriteRules to the following:
RewriteRule ^(.*)$ http://mobile.yourdomain.com$1 [R=301]
Otherwise you'll be redirecting all requests to the mobile home page (though that might be what you want).
chrispix
2010-07-07 17:27:45