Apache ReWrite rules can be used to route the users to the respective optimized version.
Here is my Apache rewrite rule that I use to check if its an Symbian, Android or Blackberry Phone and redirect to its optimized version. ( .htaccess file needs to be updated with the below rewrite code)
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} !android|avantgo|blackberry|blazer|compal|symbian
RewriteRule ^$ http://www.mydomain.com/desktop [L,R]
RewriteCond %{HTTP_USER_AGENT} android|avantgo|blackberry|blazer|compal|symbian
RewriteRule ^$ http://www.mydomain.com/mobile [L]
as the url indicates that desktop link is made for the devices which are not symbian, blackberry and the mobile is made for the mentioned devices.
Here is my Apache rewrite rule that I use to check if its an Symbian, Android or Blackberry Phone and redirect to its optimized version. ( .htaccess file needs to be updated with the below rewrite code)
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_USER_AGENT} !android|avantgo|blackberry|blazer|compal|symbian
RewriteRule ^$ http://www.mydomain.com/desktop [L,R]
RewriteCond %{HTTP_USER_AGENT} android|avantgo|blackberry|blazer|compal|symbian
RewriteRule ^$ http://www.mydomain.com/mobile [L]
as the url indicates that desktop link is made for the devices which are not symbian, blackberry and the mobile is made for the mentioned devices.
No comments:
Post a Comment