1

I want to redirect users from Android and iOS to the corresponding market to install an app. I want to open the market directly if in my URL is the string "mobile" present. But i didn't figured out how the URL must be given. Till now i only redirect to the web version of the markets. I thought should be something like market://?

Here is what i got so far:

RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} "iphone|ipod|ipad" [NC]
RewriteRule ^(.*)mobile(.*)$ http://www.apple.com [R=301,L]

#redirect to android market
RewriteCond %{HTTP_USER_AGENT} "android" [NC]
RewriteRule ^(.*)mobile(.*)$ https://play.google.com/[R=301,L]
JanScott
  • 265
  • 1
  • 5
  • 14

1 Answers1

1

Did you try to link to the app on the App Store/Google Play? In your example, "apple.com" and "play.google.com" will take you to Apple and Play Store homepages. You should provide valid URLs for apps currently on the stores. If the app isn't yet in the stores, you could try with an app that is currently online. Take a look at:

Community
  • 1
  • 1
Nicola Giancecchi
  • 3,045
  • 2
  • 25
  • 41