mobile user agent detection with htaccess
I want to redirect ipad/iphone and android to a specific page that tells
the user to get the app or continue to the main site.
I thought I could do this with htaccess:
RewriteCond %{HTTP_USER_AGENT} "android|ipad|iphone|ipod" [NC]
RewriteRule ^(.*)$ http://www.example.com/getapp [L,R=302]
The problem with this is that the page you are redirected to gives you the
option to get the app (from play or itunes) and it has a link to go to the
main site (www.example.com).
That just puts me in a loop. What is a better way to do this?
No comments:
Post a Comment