我已經爲了插在我的網站的.htaccess以下被錄取到HSTS preload list:如何使用HTTP禁用HSTS標頭?
<ifModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
</ifModule>
的問題是,當我提出我的網站,我得到:
Warning: Unnecessary HSTS header over HTTP. The HTTP page at http: //fabriziorocca.it sends an HSTS header. This has no effect over HTTP, and should be removed.
目前我在.htaccess中使用以下命令以便從http切換到https:
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
我該如何解決問題?
預先感謝您。
的可能的複製[如何設置從的.htaccess HSTS頭只在HTTPS(http://stackoverflow.com/questions/24144552/how-to -set-hsts-header-from-htaccess-only-on-https) – Tom