2014-10-27 97 views
0

在過去,我使用了基於屏幕大小的重定向腳本版本,目前由於移動設備中屏幕大小的不同,現在我遇到了問題。以下是我的.htaccess腳本的全部內容,但我的網站並不想重定向。我已經嘗試了所有我能想到的工作。我有缺陷嗎?使用.htaccess甚至有效嗎?.htaccess移動重定向

RewriteEngine on 
RewriteCond %{REQUEST_URI} !^/http://m.bayarearetractablescreen.com/.$ 
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC] 
RewriteRule ^(.)$ /http://m.bayarearetractablescreen.com/ [L,R=302] 

回答

0

我發現一對夫婦的修復(量詞點後,字符串匹配$,在最後一排在末尾加上斜槓的假結束)。

RewriteEngine on 
RewriteCond %{REQUEST_URI} !^/http://m.bayarearetractablescreen.com/ 
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC] 
RewriteRule ^(.*)$ http://m.bayarearetractablescreen.com/ [L,R=302] 

此:RewriteCond %{HTTP_HOST} !^m.bayarearetractablescreen.com$將是第2行

FYI一個更好的選擇:你可能想看看here爲你的目的更新的規則。