Check explainer · v1
HSTS: keep visitors on https after the first visit
Last reviewed
The redirect gets visitors to https once. HSTS is what keeps every later request there — before the first byte of an http request can be intercepted.
How this check works
The check reads the strict-transport-security max-age header on the origin’s representative response. A missing header fails; a declared max-age passes. Non-HTTPS origins are not judged — there is no transport to enforce. HSTS is host-level, so one representative page speaks for the origin.
What does a failure look like?
A site that redirects http to https but never sends the header — every first visit still starts in cleartext; a header set on the apex while www or the CDN hostname omits it; a max-age of zero left from a rollout template.
How to fix it, step by step
- Send strict-transport-security with a max-age on every https response, including CDN hostnames.
- Start with a short max-age while validating, then raise it — includeSubDomains only when every subdomain is ready.
- Re-run the audit and confirm the representative page reports the header with a non-zero age.
What does a pass or fail look like?
Good
strict-transport-security: max-age=31536000 on the origin’s representative response.
Fail
The site redirects to https on every request but sends no HSTS header — each first visit is interceptable before the redirect.
Frequently asked questions
What does max-age actually control?
How long the browser remembers to refuse plain http for this host. During that window the browser upgrades before any network request, which is the protection a redirect cannot provide — it never leaves the machine until https is confirmed.
Why does a short max-age pass?
Because the check grades presence with a real value, not a particular duration. A short max-age is the correct way to roll HSTS out; raising it is an operational decision the crawl does not second-guess.
Why only one representative page per origin?
HSTS is a host-level response header: if the origin sends it, every page on that origin inherits it. Grading every page would repeat one fact dozens of times.
This rule is one of the checks the audit runs. Run the full site audit
Free preview; no account needed.