Apache .htaccess用于移动重定向
在过去,我使用了基于屏幕大小的重定向脚本版本,现在由于移动设备屏幕大小的变化,我遇到了问题。下面是我的.htaccess脚本的全部内容,但我的站点不想重定向。我已经想尽一切办法让这一切顺利。我有臭虫吗?使用.htaccess是否有效Apache .htaccess用于移动重定向,apache,.htaccess,redirect,url-rewriting,Apache,.htaccess,Redirect,Url Rewriting,在过去,我使用了基于屏幕大小的重定向脚本版本,现在由于移动设备屏幕大小的变化,我遇到了问题。下面是我的.htaccess脚本的全部内容,但我的站点不想重定向。我已经想尽一切办法让这一切顺利。我有臭虫吗?使用.htaccess是否有效 RewriteEngine on RewriteCond %{REQUEST_URI} !^/http://m.bayarearetractablescreen.com/.$ RewriteCond %{HTTP_USER_AGENT} "android|black
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\u HOST}^m、 BayArea RetractableScreen.com$
将是第2行的更好选择
仅供参考:您可能需要为您的目的查找更新的规则
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]