Apache (2.0) mod_headers 不输出环境变量?
我的 .htaccess 文件:
Header add X-Hello "time %D"
现在我检查一下它的样子,查看 X-Hello
标头:
$curl -v http://foo.com/bar.php
...
< HTTP/1.1 200 OK
< Date: Wed, 06 Oct 2010 20:43:39 GMT
< Server: Apache
< Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Pragma: no-cache
< Set-Cookie: PHPSESSID=7d32d8fch8qrnnuvoqqopr74c0; path=/
< X-Hello: time %D
< Transfer-Encoding: chunked
< Content-Type: text/html
这显然与下面的 Apache 文档相反。 mod_headers
是否需要其他指令来插入环境变量?
http://httpd.apache.org/docs/2.0/mod/mod_headers .html#examples
My .htaccess file:
Header add X-Hello "time %D"
Now I check to see what it looks like, check out the X-Hello
header:
$curl -v http://foo.com/bar.php
...
< HTTP/1.1 200 OK
< Date: Wed, 06 Oct 2010 20:43:39 GMT
< Server: Apache
< Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Pragma: no-cache
< Set-Cookie: PHPSESSID=7d32d8fch8qrnnuvoqqopr74c0; path=/
< X-Hello: time %D
< Transfer-Encoding: chunked
< Content-Type: text/html
Which is clearly contrary to the Apache documentation below. Is there some other directive that mod_headers
needs in order to interpolate environment variables?
http://httpd.apache.org/docs/2.0/mod/mod_headers.html#examples
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在没有其他说明的情况下,托管提供商承认仍在使用 Apache 1.3,它不会在
mod_header
中插入值。Without note otherwise, hosting provider admitted to still using Apache 1.3 which does not interpolate values in
mod_header
.