【发布时间】:2018-08-20 17:26:24
【问题描述】:
我的.htaccess 文件中有以下几行。
<ifModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=16070400; includeSubDomains; preload" env=HTTPS
</ifModule>
但是我知道我的网站没有发送 HSTS 标头。
HTTP/1.1 200 OK
Date: Mon, 20 Aug 2018 17:15:20 GMT
Server: Apache
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
X-Pingback: https://www.xxxxxx.co.uk/xmlrpc.php
Link: <https://www.xxxxxxxx.co.uk/>; rel=shortlink, <https://www.xxxxx.co.uk/wp-json/>; rel="https://github.com/WP-API/WP-API"
Set-Cookie: PHPSESSID=ch4b175rshdlqwlrq3ij8cgo441; path=/
Content-Type: text/html; charset=UTF-8
如果我运行apachectl -M,我可以在列表中看到headers_module (shared),所以知道模块在那里。
还有其他地方可以覆盖这些设置吗?在 htaccess 文件中设置的所有其他设置都可以正常工作。
【问题讨论】:
标签: apache .htaccess http-headers hsts