简体   繁体   English

htaccess,用户代理字符串和Firefox

[英]htaccess, user agent string and firefox

new here. 新来的。
so please forgive if i don't post correctly. 因此,如果我发帖不正确,请原谅。

I am trying to use this code in my htaccess file, 我正在尝试在htaccess文件中使用此代码,

RewriteCond %{HTTP_USER_AGENT} ^DISCo Pump [NC,OR]

the code works fine in chrome or IE, (i have many others using the same formula) 该代码在chrome或IE中可以正常工作((我还有许多其他人使用相同的公式)
but it is only firefox that throws me an error 500 page. 但是只有firefox使我出错500页。
and cpanel error log says 和cpanel错误日志说
[alert] [client xx.xx.xx.xxx] /home/user/public_html/.htaccess: RewriteCond: bad flag delimiters
this has me stumped because it works fine in IE and chrome browsers. 这让我感到困惑,因为它在IE和chrome浏览器中可以正常工作。
It is only when i view my website with firefox that it generates the error. 只有当我使用Firefox浏览我的网站时,它才会产生错误。
can anyone explain this please ? 有人可以解释一下吗?
does firefox possibly use"disco pump" as part of its browser coding? Firefox是否可能在其浏览器代码中使用“迪斯科泵”?
I am a novice not a Guru. 我是新手,不是大师。
thanks. 谢谢。

RewriteCond %{HTTP_USER_AGENT} ^DISCo Pump [NC,OR] are 5 'parts' instead of 4 if you split it on spaces. RewriteCond %{HTTP_USER_AGENT} ^DISCo Pump [NC,OR]是5个“部分”,而不是将其拆分为4个部分。 I think the rule doesn't match or fails on one of the previous conditions in other browsers. 我认为该规则与其他浏览器中的先前条件之一不匹配或失败。 If mod_rewrite reaches this condition, it sees Pump as the 3rd argument and expects flags there, because the space is not escaped. 如果mod_rewrite达到此条件,则它将Pump视为第三个参数,并在该处期待标志,因为不会转义空格。 The fix is simply to escape the space with a \\ . 解决方法是简单地使用\\来转义空格。

RewriteCond %{HTTP_USER_AGENT} ^DISCo\ Pump [NC,OR]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM