Apache (2.0) mod_headers 不输出环境变量?

发布于 2024-09-26 02:00:35 字数 800 浏览 2 评论 0原文

我的 .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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谎言 2024-10-03 02:00:35

在没有其他说明的情况下,托管提供商承认仍在使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文