Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I could not find one topic on HSTS here on yet so here it comes:

I want to setup HSTS so that my webserver will force the browsers to use HTTPS.

Does anyone know how to set this up for apache2 in a proper way?

share|improve this question
up vote 1 down vote accepted

It's really yout application that should be setting this imho, but you can use Header set to make apache do it:

Header set Strict-Transport-Security "max-age=31536000"
share|improve this answer
Thats also what i tried and i can see that it is implemented in the http header but it is still possible to go to so it does not work? – dhojgaard Dec 5 '12 at 23:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.