我有一个.htaccess代码,可以将智能手机上的每个用户重定向到兼容的网站:
RewriteEngine On
RewriteEngine On
RewriteCond %{QUERY_STRING} !^desktop
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|googlebot-mobile|iemobile|iphone|ipod|#opera mobile|palmos|webos" [NC]
RewriteRule ^ http://logo.artliner.co.il//mobile.html%{REQUEST_URI} [R,L]
此代码导致无限循环,如下所示:http://logo.artliner.co.il//mobile.html/mobile.html/mobile.html/mobile.html/mobile.html/mobile.html/mobile.html/
你能帮我解决这个问题并停止循环吗?谢谢!
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{QUERY_STRING} !^desktop
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|googlebot-mobile|iemobile|iphone|ipod|#opera mobile|palmos|webos" [NC]
RewriteRule !^mobile.html$ /mobile.html [R,L]
只有在请求URI模式不完全符合RewriteRule
时才会应用mobile.html
。