Code:
RewriteCond %{HTTP_USER_AGENT} "Android|iPhone|iPad" [NC]
all smartphones and tablets contains "Android" in UA.
all iPhones conraians "iPhone" in UA.
all iPads conraians "iPad" in UA
UAs above coverage 99% of present mobile devices .
all others strings NOT NEEDED!
Windows Mobile or iPod now not used for Internet surfing.
Hi @AndreyPopov !
I have separate banners, mobile and desktop version.
The only way I managed to make the detection work was using this detection list that I got from the litespeed faq.
RewriteEngine On
RewriteCond% {HTTP_USER_AGENT} "iPhone | iPod | BlackBerry | Palm | Googlebot-Mobile | Mobile | mobile | mobi | Windows Mobile | Safari Mobile | Android | Opera Mini android | avantgo | blackberry | blazer | compal | elaine | fennec | hiptop | iemobile | ip (hone | od) | iris | kindle | lge \ | maemo | midp | mmp | opera \ m (ob | in) i | palm (\ os)? | phone | p (ixi | re) \ / | plucker | pocket | psp | symbian | treo | up \. (navegador | link) | vodafone | wap | windows \ (ce | phone) | xda | xiino "[NC]
RewriteRule. * - [E = Cache-Control : variar = ismobile]
With the list reduced, some Apple devices and my Samsung Galaxy note 8 was not recognized, the desktop banners were visualized on mobile.
After adding this more complete list, mobile banners were recognized on both phones.