By SitemapFixer Team
Updated May 2026

HSTS: HTTP Strict Transport Security and SEO

HTTP Strict Transport Security (HSTS) is a response header that tells browsers to refuse any future connection to your domain over plain HTTP. It is one of the most important security headers a site can ship, and it has indirect but meaningful SEO benefits. It is also one of the easiest headers to misconfigure in a way that breaks your site for months. This guide covers what HSTS does, how it touches SEO, and how to deploy it without painting yourself into a corner.

Check whether your site ships HSTS, HTTPS, and other technical signals correctly.Try SitemapFixer Free

1. What Is HSTS?

HSTS, defined in RFC 6797, is a mechanism that lets a website declare to browsers: I am only ever to be accessed over HTTPS. If you ever see a plain http:// link to me, upgrade it before sending the request, and refuse to connect if my certificate fails. Once a browser receives the HSTS header, it remembers the policy for a configurable period and applies it automatically.

The benefit is that it eliminates an entire category of attacks: SSL-stripping, where an attacker sitting between the user and the server downgrades the connection to HTTP and intercepts the traffic. With HSTS active, the browser refuses to ever talk HTTP to your domain, so there is nothing to strip.

2. The Strict-Transport-Security Header

HSTS is delivered as a single response header on HTTPS responses. The canonical, preload-ready value is:

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

A more conservative starting value, suitable for the first weeks after enabling, omits subdomains and preload:

Strict-Transport-Security: max-age=31536000

Browsers ignore the header on plain HTTP responses, so it must be served from your HTTPS endpoint to take effect.

3. How HSTS Improves SEO Indirectly

HSTS is not a direct ranking factor — Google does not give a bonus for the header itself. But it reinforces three signals that do influence rankings:

4. Understanding the max-age Directive

The max-age directive specifies, in seconds, how long the browser should remember and enforce the HSTS policy after the last time it saw the header. Common values:

Setting max-age=0 tells the browser to forget the policy immediately — useful as an escape hatch if you need to back out, but only effective for browsers that revisit the site before their cached policy expires.

5. The includeSubDomains Directive

Adding includeSubDomains extends the HSTS policy to every subdomain of the domain that served the header. If example.com sets it, then blog.example.com, shop.example.com, and internal.dev.example.com all become HTTPS-only in the browser's view.

This is powerful and dangerous in equal measure. Before enabling it, audit every subdomain you own — including legacy marketing pages, internal tools, and forgotten staging environments — and confirm each one has a valid TLS certificate and serves over HTTPS. A single subdomain stuck on HTTP becomes unreachable for any user whose browser has cached your HSTS policy.

6. The preload Directive and the HSTS Preload List

The preload directive is a flag indicating that the site owner wants the domain added to the HSTS preload list — a hardcoded list of HTTPS-only domains shipped inside Chrome, Firefox, Safari, Edge, and Opera. Browsers consult the list before making the first connection to a domain.

The benefit: even a brand-new browser that has never visited your site will refuse to connect over HTTP. There is no first-visit window of vulnerability. The cost: removal from the preload list takes weeks to months and requires a new release cycle of every major browser.

7. How to Submit Your Site to the HSTS Preload List

Submission happens at hstspreload.org. The eligibility checklist:

Approval typically takes a few weeks. The actual hardcoding into browsers ships in subsequent releases, so it can be 2–3 months before the preload status is fully active across the user base.

8. HSTS and Site Migrations

HSTS preload is one of the few decisions in technical SEO that is genuinely hard to undo. If you preload example.com and later need to spin up an HTTP-only test subdomain, run a third-party widget on a non-HTTPS domain, or migrate to a host that doesn't yet have your cert provisioned, every preloaded browser will refuse to connect.

Before any major migration — domain change, hosting migration, CDN swap — verify that HTTPS will be available on every host name from day one. If you're migrating to a new domain, the HSTS policy on the old domain doesn't transfer, so you will need to repeat the rollout (and any preload submission) on the new domain.

9. Common HSTS Mistakes

# nginx.conf
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;

10. Testing HSTS Configuration

Three quick checks to confirm the header is live:

curl -sI https://example.com | grep -i strict-transport

# Expected output:
strict-transport-security: max-age=31536000; includeSubDomains; preload
Ship secure, SEO-friendly headers
SitemapFixer audits HSTS, HTTPS, redirect chains, and the rest of your technical SEO stack.
Run a free audit

Related Guides