What is the best HTACCESS script to re-direct mobile users to another site?
Here is what I am using currently. Do I need to add or modify anything?
Code:
#redirect mobile browsers
#Iphone detection
RewriteCond %{HTTP_USER_AGENT} ^.*iphone.*$ [NC]
RewriteRule ^(.*)$ http://mobile.somesite.com/ [R=301,L]
#Ipod detection
RewriteCond %{HTTP_USER_AGENT} ^.*ipod.*$ [NC]
RewriteRule ^(.*)$ http://mobile.somesite.com/ [R=301,L]
#Android detection
RewriteCond %{HTTP_USER_AGENT} ^.*android.*$ [NC]
RewriteRule ^(.*)$ http://mobile.somesite.com/ [R=301,L]
#Blackberry detection
RewriteCond %{HTTP_USER_AGENT} ^.*blackberry.*$ [NC]
RewriteRule ^(.*)$ http://mobile.somesite.com/ [R=301,L]
#Samsung detection
RewriteCond %{HTTP_USER_AGENT} ^.*sgh.*$ [NC]
RewriteRule ^(.*)$ http://mobile.somesite.com/ [R=301,L]
#Sony Ericsson detection
RewriteCond %{HTTP_USER_AGENT} ^.*sonyericsson.*$ [NC]
RewriteRule ^(.*)$ http://mobile.somesite.com/ [R=301,L]
#Playstation Portable detection
RewriteCond %{HTTP_USER_AGENT} ^.*psp.*$ [NC]
RewriteRule ^(.*)$ http://mobile.somesite.com/ [R=301,L]
#Motorolla detection
RewriteCond %{HTTP_USER_AGENT} ^.*mot.*$ [NC]
RewriteRule ^(.*)$ http://mobile.somesite.com/ [R=301,L]
#HTC detection
RewriteCond %{HTTP_USER_AGENT} ^.*htc.*$ [NC]
RewriteRule ^(.*)$ http://mobile.somesite.com/ [R=301,L]
#LG detection
RewriteCond %{HTTP_USER_AGENT} ^.*lg.*$ [NC]
RewriteRule ^(.*)$ http://mobile.somesite.com/ [R=301,L]
#iPAQ detection
RewriteCond %{HTTP_USER_AGENT} ^.*lg.*$ [NC]
RewriteRule ^(.*)$ http://mobile.somesite.com/ [R=301,L]
#PALM detection
RewriteCond %{HTTP_USER_AGENT} ^.*up\.browser|up\.link|mmp|symbian|smartphone|midp|wap|vodafone|pocket|kindle|mobile|treo.*$ [NC]
RewriteRule ^(.*)$ http://mobile.somesite.com/ [R=301,L]
#Nokia detection
RewriteCond %{HTTP_USER_AGENT} ^.*nokia.*$ [NC]
RewriteRule ^(.*)$ http://mobile.somesite.com/ [R=301,L]
#Opera Mini detection
RewriteCond %{HTTP_USER_AGENT} ^.*opera.mini.*$ [NC]
RewriteRule ^(.*)$ http://mobile.somesite.com/ [R=301,L]