HTTPS and HSTS header checker
We check that the final URL after redirects uses https, and that the response has a Strict-Transport-Security header with max-age above zero.
Why it matters
An agent that follows a link to your site over HTTP can be served altered content on the way, and many agents refuse to act on pages like that. HSTS tells the client to use HTTPS only for the stated period. HTTPS is worth 1 point and the HSTS header the second.
How to fix it
- Install a valid certificate and redirect all
http://URLs tohttps://with a 301. - Add the header
Strict-Transport-Security: max-age=31536000; includeSubDomains. - Set the header at the web server or CDN, so every response has it.
- Start with a short
max-agewhile you test, then raise it.
How to verify
Run curl -sI https://example.com/ | grep -i strict-transport and expect a max-age value.
HSTS header checker: what the scan reads and what it ignores
This HSTS checker is a scan of your live site, not a validator for pasted text. It requests your homepage with a browser User-Agent, follows redirects, and looks at two things: whether the final URL starts with https:, and whether the response carries a Strict-Transport-Security header whose max-age is greater than zero. It does not inspect the certificate, and it does not grade includeSubDomains or preload. The two responses below look similar but score differently: the first earns 2 of 2 points, the second earns 1, because max-age=0 counts as no HSTS.
$ curl -sI https://example.com/
HTTP/2 200
content-type: text/html; charset=utf-8
strict-transport-security: max-age=31536000; includeSubDomains
$ curl -sI https://weak.example.com/
HTTP/2 200
content-type: text/html; charset=utf-8
strict-transport-security: max-age=0
How the HSTS header is scored
- The header is read from the response to the homepage request, which is sent with a browser User-Agent. Headers that appear only for other paths or other clients are not seen.
- The scan extracts
max-age=<number>from the header value with a pattern match. The number must be greater than 0, somax-age=0earns nothing. - The HTTPS point depends only on the final URL after redirects. If
http://example.comredirects tohttps://example.com, the final URL is https and the point is awarded. - The HSTS point is given only when HTTPS already passed. A site that ends on plain HTTP scores 0 of 2, even if it sends the header.
- The certificate is not checked: expiry, hostname match and chain are outside this scan, so verify them separately in a browser or with your certificate tooling.
includeSubDomainsandpreloaddo not change the score. They matter for real-world security, but this check only needs a positivemax-age.
Common HSTS header mistakes
- The header is set by the application only on HTML pages, and is missing on static files, API routes or error pages. Set it at the web server or CDN so every response has it.
- The value is
max-age=0. This is the command to clear HSTS in browsers, and it scores 0 here. People leave it in after testing a rollback. - A CDN, load balancer or reverse proxy strips or overwrites the header, so it exists on your origin but not in what the scanner receives. Test the public address, not the origin.
- The header is added only on part of the paths, for example
/app/*, while the homepage does not send it. The scan reads the homepage response. - The redirect chain ends on
http://, for example an https page that redirects to a plain-HTTP hostname. The final URL is not https, so both points are lost. - Turning on
includeSubDomainsbefore auditing subdomains. Browsers then force HTTPS on every subdomain, so an old internal tool, webmail or staging host that only speaks HTTP becomes unreachable for anyone who has seen the header, untilmax-ageexpires.
HSTS FAQ
What is HSTS?
HTTP Strict Transport Security is a response header. After a browser or client sees it once over HTTPS, it connects to that host over HTTPS only for the number of seconds in max-age, and does not try plain HTTP first.
Which max-age should I set, and why 31536000?
31536000 seconds is one year, a common value for a stable site. Start with something short such as 300 while you confirm every page and subdomain works over HTTPS, then raise it. Any value above 0 passes this scan.
What does preload do, and why is it not scored?
The preload token signals that you want the domain added to the browser preload lists, so HTTPS is enforced even on the first visit. Joining those lists is a separate commitment that is hard to undo. This scan only reads the header on one response, so it does not score preload.
How can I check HSTS without the scanner?
Run curl -sI https://example.com/ | grep -i strict-transport. If nothing prints, the header is missing on that response. Add -A "Mozilla/5.0" to mimic a browser User-Agent, and -L to follow redirects.
Does HSTS affect rankings or AI agents?
Not directly. We make no claim that it changes Google rankings. In our rubric it is one point out of the trust group: a signal that the site is served securely, nothing more.