1

How can I achieve this in HTACCESS. What I want is that if a user is using a Smartphone device and access the link http://luxury.localhost/others/mypage.html he will be redirected to http://luxury.localhost/sp/entry but if he is just using a PC he will be redirected to http://luxury.localhost/entry page.

Code:

# the logic is something like this
# If using smartphone
RedirectMatch /others/mypage.html /sp/entry/

# else if using PC
RedirectMatch /others/mypage.html /entry/

Please help me.

Thanks

Paul Blundell
  • 1,857
  • 4
  • 22
  • 27
  • Maybe this can help you: http://stackoverflow.com/questions/12693388/redirect-for-mobile-device-with-htaccess-exclude-ipad – toesslab May 23 '14 at 08:09
  • Try this in your HTACCESS to redirect mobile users: ########## Begin - Redirect Mobile Browser Accessing /siteurltoredirect RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC] RewriteRule ^siteurltoredirect$ http://luxury.localhost/sp/entry [R,L] ########## End - Redirect Mobile Browser Accessing /siteurltoredirect – ChaveVrey May 23 '14 at 08:22

0 Answers0