Glossary / HSTS (Strict-Transport-Security)

HSTS (Strict-Transport-Security)

HSTS (Strict-Transport-Security) is an HTTP response header that tells the browser to talk to your site over HTTPS only. After the first visit the browser rewrites any http:// request to https:// on its own and refuses to load the site over an unencrypted connection, even if the user clicks a plain http link.

Check your site

>

The server sends the Strict-Transport-Security header with a max-age value - how many seconds the browser should remember the rule. While it is valid, every request to the domain goes over HTTPS, and an attempt to open the http version turns into an internal redirect before the request ever leaves the machine.

This shuts down downgrade and first-hop interception attacks, where someone on the same network feeds the user an http version of the site. The includeSubDomains directive extends the rule to every subdomain, and preload lets you add the domain to the list built into browsers so the protection applies before the very first visit.

Turn HSTS on only once the whole site and its subdomains reliably serve HTTPS. Otherwise some pages become unreachable and you cannot roll it back quickly, because the browser keeps the rule until max-age runs out.

Example

Strict-Transport-Security: max-age=31536000; includeSubDomains; preload

Common mistakes

Related terms

Found problems?

Slow hosting, SSL trouble or frequent downtime? Move to TomisHost: fast hosting with free SSL, daily backups and free migration help.

TomisHost hosting