这个 HTTP 授权重写规则有什么作用?
我的网站上某处存在 Google Bot 导致的重写递归错误,但我找不到导致该错误的网址,因为我的日志级别较低。我提出了,但到目前为止还没有再发生过。
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
所有重写规则对我来说看起来都很好,并且都有 [L] 标志,除了这个。
我不太明白。它来自开源商店系统Magento。
据我所知,它除了设置环境变量 E 之外什么也没做。但这不是一种非常愚蠢的方法吗?如果这是目标,你不应该使用 SetEnv 吗?
I have an rewrite recursion error somewhere on my website that Google Bot caused, but I can't find the url that caused it because my Loglevel is low. I raised it but it has not happened again so far.
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
All Rewriterules look fine to me and have the [L] flag, except this one.
I can't quite understand it. It is from the open source shop system Magento.
As far as I can tell it does nothing but sets the environment variable E. But isn't that a very stupid way of doing that? Shouldn't you use SetEnv if that was the goal?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Symfony 开发者小组对此有一个很好的答案。我引用:
它对我有用
Symfony developers Group has a good answer for it. I quote:
It worked for me
此行将环境变量设置为用户身份验证字符串的值 - 本质上是设置一个变量而不是常量值。据我所知,SetEnv 和 SetEnvIf 只允许您将环境变量设置为预定常量。
正在设置的变量实际上是 HTTP_AUTHORIZATION,而不是 E。我猜这是用户身份验证过程的一部分。
This line is setting the environment variable to the value of user authentication string - essentially setting a variable rather than constant value. As far as I know, SetEnv and SetEnvIf only allow you to set an environment variable to a predetermined constant.
The variable being set is actually HTTP_AUTHORIZATION, not E. I would guess this is part of the user authentication process.