我已将我的站点 test.com 的域名更改为 test2.com
域名从test.com to test2.com
I want to know if all the pages like test.com/* will be redirected to test2.com/*
在 test2.com 中,我正在 mod_rewrite 中编写重写规则来识别智能移动设备。
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/*
为此,我研究了以下条件。我不确定这是否正确。
我试过这样的事情。
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]