Security glossaryHTTP Strict Transport Security (HSTS) is a response header that tells browsers to load a site only over HTTPS. Connections then cannot be downgraded to plain HTTP.
HTTP Strict Transport Security (HSTS) is a response header that tells browsers to only ever load a site over HTTPS. Once a browser has seen it, it upgrades every http:// link to the site to https:// by itself, so an attacker on the same network cannot force an unencrypted connection.
The header
Strict-Transport-Security: max-age=31536000; includeSubDomains tells the browser to remember the rule for a year and apply it to every subdomain. Sites can also ask to be added to the browsers' built-in preload list, which protects even the very first visit.
Before you turn it on
Every page and subdomain must already work over HTTPS with a valid SSL certificate. Browsers enforce the rule for the whole max-age, so a mistake cannot be undone quickly. Start with a short max-age and raise it. Our free WordPress security check shows whether a site sends the header.
Source: MDN: Strict-Transport-Security.