I have changed my Domain name of my site test.com to test2.com
Domain name changed from test.com to test2.com
I want to know if all the pages like test.com/* will be redirected to test2.com/*
In test2.com, I am writing the rewrite rule in mod_rewrite to identify the smart mobile device.
For all smart phone I would like to redirect requests test.com/* to test2.com (home page)
For every non smart phone I would like to redirect test.com/* to test2.com/*
I have researched the following condition for this. I am not sure if this is correct or not.
I have tried some thing like this.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^test\.com$ [AND]
RewriteCond %{HTTP_USER_AGENT} mobile
RewriteCond %{HTTP_USER_AGENT} !(android|blackberry|iphone|ipod|windows phone) [NC]
RewriteRule ^(.*)$ http://test2.com/mobil/#1 [L]