0

We are using this piece of code to redirect on mobile website.

RewriteCond %{HTTP_USER_AGENT} android|blackberry|iphone|ipod|iemobile|palmos|webos|googlebot-mobile [NC]

But problem is, Its also working for tablet. Because tablet is also android. We don't want to redirect on tablet. We want redirection only on mobiles.

What we need to change in this? Please suggest only .htaccess change.

Renu Thakur
  • 551
  • 11
  • 35
  • Isn't the screen size more relevant than the name of the user agent? or when is a device a "tablet" and when is it a "mobile"? Screen size isn't in the headers, so you'd need to use JavaScript to find out and then redirect. – Claude Martin Oct 21 '15 at 12:56
  • There is lots of code. We need to run old code(not written by us) on mobile and new code(Written by us) on tablet and on website. Because old code is handling for mobile template. So we cant do detection in headers. – Renu Thakur Oct 21 '15 at 13:01
  • 1
    Possible duplicate of [Android phone or Android tablet detection by http headers](http://stackoverflow.com/questions/9829716/android-phone-or-android-tablet-detection-by-http-headers) – Claude Martin Oct 21 '15 at 13:14

0 Answers0