User Agent redirect

Permalink
Could do with a bit of help with a htaccess redirect .

We have created a page at http://www.tap-it.com/download (we have pretty URL's enabled), and would like to redirect this page based on the user agent. So if the user agent is android we want to redirect tohttps://play.google.com/store/apps/details?id=com.xantura.tap_it...

and if on iPhone it should go tohttps://itunes.apple.com/gb/app/tap-it-safety-app/id722909910?ls=1&a...

I am attempting this in the htaccess file and so far are failing.

I have tried:

RewriteCond %{HTTP_USER_AGENT} iphone/ipad/ipod [NC]
RewriteCond %{REQUEST_URI} !^/download/
RewriteRule .*https://itunes.apple.com/gb/app/tap-it-safety-app/id722909910?ls=1&a... [R]

RewriteCond %{HTTP_USER_AGENT} android [NC]
RewriteRule ^(.*)/download/(.*)$ https://play.google.com/store/apps/details?id=com.xantura.tap_it... [R,L]

neither of which seem to work.

Anyone out there can help me that would be great

servondesign
 
johnpaulb replied on at Permalink Reply
johnpaulb
Hello servondesign,

You should be able to accomplish this with a 301 redirect, which is explained here:
http://www.inmotionhosting.com/support/website/redirects/setting-up...

I hope this helps,
John-Paul