My web application runs on a different number of hosts that I control. To prevent the need to change the Apache configuration for each vhost, I add most of the configuration using the .htaccess files in my repo, so the basic setup of each host is just a few lines. It also allows you to change the configuration when you deploy the new version. Currently .htaccess (un) sets headers, rewrites magic and controls UA caching.
I want to include HSTS in an application using .htaccess. Just customizing the title is easy:
Header always set Strict-Transport-Security "max-age=31536000"
However, the specification clearly states: "The HSTS host MUST NOT include the STS header field in HTTP responses sent over insecure transport." Therefore, I do not want to send the header when sending over HTTP connections. See http://tools.ietf.org/html/draft-ietf-websec-strict-transport-sec-14 .
I tried to set the header using the vars environment, but I was stuck there. Who knows how to do this?
apache .htaccess mod-headers
nielsr Jun 10 '14 at 15:10 2014-06-10 15:10
source share