GlossarySEO
What is HSTS?
Also called: HTTP Strict Transport Security, Strict-Transport-Security, HSTS preload
Definition
HSTS (HTTP Strict Transport Security) is a response header telling browsers to only ever connect to your domain over HTTPS, for a set period. Browsers then upgrade any http:// link before sending it.
HSTS, explained
The header looks like Strict-Transport-Security: max-age=63072000; includeSubDomains; preload. MDN describes the directives: max-age is how many seconds the browser remembers the policy, includeSubDomains applies it to every subdomain, and preload signals that you want the domain included in browsers' built-in preload lists. Preloading requires a max-age of at least one year and includeSubDomains.
Browsers only honor the header when it arrives over HTTPS. After that, for the duration of max-age, they rewrite any HTTP request to your domain to HTTPS internally, and they won't let users click through certificate errors. In Chrome's network panel you'll see this as a "307 Internal Redirect", which never reaches your server. The first visit before the browser has seen the header isn't protected, which is the gap the preload list closes.
For SEO, HSTS isn't a ranking signal on its own, but it's part of doing HTTPS properly, and Google's 2014 HTTPS announcement recommended it. It removes a redirect hop for returning visitors and prevents downgrade attacks.
Be careful with scope. MDN warns that once includeSubDomains is set, the policy is hard to walk back: it persists in browsers until it expires, and can only be cleared early with max-age=0 served over HTTPS. If any subdomain, like an old marketing tool or a staging server, can't serve HTTPS, it will break for visitors. Start with a short max-age, confirm everything works, then increase it.
Why it matters for founders
HSTS is a one-line security header that makes your HTTPS setup complete. The risk is setting it too broadly before every subdomain supports HTTPS.
Example
You add Strict-Transport-Security: max-age=300 for a week, confirm nothing breaks, then raise it to two years with includeSubDomains once every subdomain serves HTTPS.
Common mistakes
- Preloading before every subdomain supports HTTPS.
- Starting with a two-year
max-ageon day one. - Sending the header over HTTP, where browsers ignore it.
- Mistaking the browser's 307 internal redirect for a server redirect.
Sources
Checked
Related terms
- HTTPSHTTPS is HTTP over an encrypted TLS connection, shown by
https://and a padlock in browsers. Google has used it as a lightweight ranking signal since 2014, and browsers warn users about sites without it. - Mixed contentMixed content is when a page loaded over HTTPS includes resources, like images, scripts or iframes, loaded over plain HTTP. Browsers upgrade or block those requests, which can break the page.
- 307 vs 308 redirectA 307 is a temporary redirect and a 308 is a permanent one. Unlike 302 and 301, both require the browser to repeat the request with the same method and body. Google treats 308 like 301 and 307 like 302.
- www vs non-wwwwww vs non-www is the choice between serving your site at
www.example.comorexample.com. Either works for SEO. What matters is picking one and permanently redirecting the other to it.