我想根据用户代理
将查询字符串附加到我的所有网址例如:xyz.com/buy.html to
xyz.com/buy.html?eq = mobile`
xyz.com/more/buy.html
至xyz.com/more/buy.html?eq=mobile
#RewriteCond %{HTTP_USER_AGENT} "android|blackberry|googlebot-mobile|iemobile|ipad|iphone|ipod|opera mobile|palmos|webos" [NC]
正在检测移动浏览器,但无法写出正确的RewriteRule
答案 0 :(得分:0)
您需要确保查询字符串不存在:
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|googlebot-mobile|iemobile|ipad|iphone|ipod|opera mobile|palmos|webos" [NC]
RewriteCond %{QUERY_STRING} !^eq=mobile
RewriteRule ^(.*)$ $1?eq=mobile [L,QSA]