5 minutes
- Header value
Strict-Transport-Security: max-age=300; includeSubDomains- Use when
- You have examined all subdomains, including nested and internal ones, and confirmed they work over HTTPS.
Understand what HSTS protects, verify the response header, and roll out HTTPS enforcement safely across a site's hosts and subdomains.
HTTP Strict Transport Security (HSTS) tells browsers to use HTTPS for future connections and block bypasses of certificate errors. It is a browser security policy, not a Search Console warning or a substitute for redirects and valid certificates. Confirm each intended subdomain supports HTTPS before adding includeSubDomains, and treat preload as a long-term commitment.
Four quick questions, then a straight answer.
From your answers, this is quietly costing you traffic and nobody has the hours to chase it. Scaplet finds every affected page, drafts the fixes and tracks how AI answers mention you.
A data platform shipped 46 fixes without a ticket.
This looks handled. Re-check after a redesign, a migration or a big content push; that is when it breaks.
Your site is small and you have the time. Work through the steps on this page, starting with the pages that get the most traffic.
Strict-Transport-Security response header tells a browser that the host should only be accessed over HTTPS. After receiving the policy on a secure response, the browser remembers it for the specified max-age and upgrades later HTTP attempts to HTTPS. It also prevents users from bypassing certain secure-connection errors, such as an invalid certificate.HSTS is useful after HTTPS works reliably. It does not install a certificate, repair an HTTP page, fix mixed content, or replace a server redirect for visitors and crawlers that do not already remember the policy. Google documents HSTS as one signal that can support preferring HTTPS URLs as canonical, while also saying HSTS cannot override a bad certificate or HTTPS-to-HTTP redirects.
Use DevTools Network or a header inspection tool on the final HTTPS response. Look for Strict-Transport-Security in the response headers, not in the HTML source.
Test the apex domain, www, login and API hosts, and any other subdomain that should serve pages. Each host should be able to return HTTPS and send its intended policy.
Request the HTTP version and confirm it reaches the intended HTTPS URL with a permanent redirect such as 301; MDN says that redirect must not carry the HSTS header. Inspect the certificate for each relevant hostname and verify that HTTPS does not redirect back to HTTP.
Record max-age, whether includeSubDomains is present, and whether preload is included. Confirm that the values match the rollout decision and current hosting configuration.
Browsers learn HSTS from secure HTTPS responses, not from an insecure HTTP response. Test with a clean browser profile or an HTTP header checker when you need to confirm the origin is sending the header; a browser's remembered policy can hide a missing header on a later visit, since a previously received header stays in effect until it expires.
Strict-Transport-Security: max-age=300; includeSubDomainsStrict-Transport-Security: max-age=604800; includeSubDomainsmax-age and found no broken pages or metric drops.Strict-Transport-Security: max-age=2592000; includeSubDomainsmax-age of each stage before moving on.Strict-Transport-Security: max-age=31536000; includeSubDomains; preloadThe staged values come from hstspreload.org, the preload service Google hosts. Its submission form requires a valid certificate, an HTTP-to-HTTPS redirect on the same host if you listen on port 80, HTTPS on all subdomains (including www if a DNS record exists), and an HSTS header on the base domain with max-age of at least 31536000 seconds, includeSubDomains, and preload. MDN adds that every subdomain host should send the header itself, because a browser may contact a subdomain before the parent domain, and that the header must be sent over HTTPS only: browsers ignore it over HTTP.
If you need to turn off a policy, max-age=0 removes it when a browser receives that header over HTTPS. MDN also says that if a response from a host that previously sent the header omits it, the previous policy stays in effect until it expires, and that you cannot disable HSTS over insecure HTTP. Plan a rollback from a working HTTPS endpoint.
max-age or adding subdomains.Google says it prefers equivalent HTTPS URLs as canonical, but its troubleshooting guidance also calls out invalid certificates, HTTPS pages with insecure dependencies, redirects through HTTP, and an HTTPS page canonicalized to HTTP as conflicting signals. Fix those fundamentals first; HSTS cannot override them.
After rollout, recheck the HTTPS response headers on every intended host, monitor certificate renewals, and keep a current inventory of subdomains. A header that makes the main site safer can also make a forgotten subdomain inaccessible until its HTTPS setup is repaired.
3 questions people ask next, answered from the sources on this page.
Google documents HSTS as one signal that can support choosing HTTPS as canonical over an equivalent HTTP URL. The header's primary function is browser security, and it does not override bad certificates or conflicting HTTPS setup.
Only if every subdomain in scope supports HTTPS and will continue to do so. Otherwise, the policy can make those hosts unreachable in browsers that have learned it.
A browser that already knows the HSTS policy upgrades future HTTP attempts. Keep a server-side HTTP-to-HTTPS redirect for first-time visitors and other clients.
Run the free audit, then approve the fixes. Every change can be undone.