2012-07-10 58 views
0
RewriteEngine on 

RewriteBase/

RewriteCond %{HTTP_USER_AGENT} (Android|iPhone|iPod|Blackberry) [NC] 
RewriteCond %{HTTP_HOST} !^m.reports.com [NC] 
RewriteRule ^(.*)$ http://m.reports.com/$1 [QSA,L,R=301] 

那不會重定向到我的新域..爲什麼?!!?簡單的服務器重定向到另一個域不適用於mod_rewrite

+1

是mod_rewrite工作?你有沒有嘗試過簡單的重定向?請檢查AllowOverride全部 – 2012-07-10 10:58:57

+0

我該怎麼做? – 2012-07-10 13:40:03

+0

在/etc/httpd/conf/httpd.conf中將AllowOverride None更改爲 AllowOverride All。也看看這裏http://ndesign-studio.com/blog/301-htaccess-redirect。只​​用於測試你的mod_rewrite看看部分「重定向整個網站」 – 2012-07-10 14:05:19

回答

0
RewriteRule ^(.*)$ http://m.reports.com/$1 [L,R=301] 

您缺少http://

+0

沒有工作...看到更新 – 2012-07-10 13:38:20

相關問題