html - Redirect to mobile site using htaccess only on Mobile devices -


i using following code in htaccess file detect mobile devices , redirect them mobile site.

but problem redirecting mobile site on tablets , ipad too. how can modify code loads full site on tablets , ipad.

   # check if noredirect query string rewritecond %{query_string} (^|&)m=0(&|$) # set cookie, , skip next rule rewriterule ^ - [co=mredir:0:www.mysite.com]  rewritecond %{http:x-wap-profile} !^$ [or] rewritecond %{http:profile}       !^$ [or] rewritecond %{http_user_agent} "acs|alav|alca|amoi|audi|aste|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-" [nc,or] rewritecond %{http_user_agent} "dang|doco|eric|hipt|inno|ipaq|java|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-" [nc,or] rewritecond %{http_user_agent}  "maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|opwv" [nc,or] rewritecond %{http_user_agent} "palm|pana|pant|pdxg|phil|play|pluc|port|prox|qtek|qwap|sage|sams|sany" [nc,or] rewritecond %{http_user_agent} "sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo" [nc,or] rewritecond %{http_user_agent} "teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|w3cs|wap-|wapa|wapi" [nc,or] rewritecond %{http_user_agent} "wapp|wapr|webc|winw|winw|xda|xda-" [nc,or] rewritecond %{http_user_agent} "up.browser|up.link|windowssce|iemobile|mini|mmp" [nc,or] rewritecond %{http_user_agent} "symbian|midp|wap|phone|pocket|mobile|pda|psp" [nc] rewritecond %{http_user_agent} !macintosh [nc]  # check if we're not on mobile site rewritecond %{http_host}          !^m\. # can not read , write cookie in same request, must duplicate condition rewritecond %{query_string} !(^|&)m=0(&|$)   # check make sure haven't set cookie before rewritecond %{http_cookie}        !^.*mredir=0.*$ [nc]  # redirect mobile site rewriterule ^ http://www.mysite.com/mobi [r,l] 

thanks , appreciate it


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -