Skip to content
FunnelGuard

Fix guide by FunnelsGuard

HSTS missing or misconfigured: how to check and fix it

SEO-095Low impactOther toolBy FunnelGuardPublished Updated
On this page

What this issue is

HSTS stands for HTTP Strict Transport Security. Your server sends a header such as Strict-Transport-Security: max-age=31536000 on https responses. A browser that sees it remembers, for that many seconds, to turn any http request for your domain into https before sending it.

Without it, someone typing yourdomain.com or clicking an old http link first makes an insecure request, and your server then redirects them. HSTS removes that first insecure hop for returning visitors.

Common misconfigurations: the header is absent; max-age is tiny (such as 0 or 300), so the browser forgets it quickly; the header is sent over plain http, where browsers ignore it; includeSubDomains is set while some subdomain still lacks a valid certificate; or preload is added without meeting the requirements.

Why it costs you leads or sales

The direct impact is usually low. HSTS is a security and hygiene signal, not a ranking switch. But it matters in a few ways: it cuts the extra http-to-https redirect for returning visitors, it protects people on public Wi-Fi from having that first request tampered with, and it keeps security scanners and procurement checks from flagging your site.

The bigger risk is the opposite mistake. If you turn on a long max-age with includeSubDomains and a subdomain (a booking tool, a landing page host, a help centre) has no valid https, browsers will refuse to load it at all, with no way for the visitor to click through. That can quietly kill a form or checkout on that subdomain.

Visit without HSTS vs the risk of a bad HSTS setup
  1. Visitor opens linkOld http link or typed domain
  2. Insecure first requestNo HSTS, so http is tried first
  3. Subdomain on bad httpsincludeSubDomains cached, certificate invalid
  4. Booking or form pageBrowser refuses to load it
  5. Lead or saleNever reached

A subdomain without valid https is blocked once includeSubDomains is cached by the browser.

How to check if your site has it

You are looking for the Strict-Transport-Security header on the https response of your main domain, and on www if you use it.

Check the header
  1. Request the headers

    Run curl -sI https://yourdomain.com in a terminal and look for a line starting strict-transport-security.

  2. Or use the browser

    Open DevTools, go to the Network tab, reload, click the first document request and read Response Headers.

  3. Check the value

    Note max-age (in seconds), and whether includeSubDomains or preload appear.

  4. Check every host

    Repeat for www, the bare domain and any subdomain that serves pages or forms.

  5. Confirm the header is on https only

    It should appear on https responses. Browsers ignore it on plain http.

Quick header checkbash
curl -sI https://yourdomain.com | grep -i strict-transport-security
# Expected, for example:
# strict-transport-security: max-age=31536000; includeSubDomains
How to read what you find
What you seeMeaningAction
No headerHSTS missingAdd it with a short max-age first
max-age=0Policy is switched offRaise it once https is stable
max-age under about 86400Browser forgets quicklyIncrease in stages
includeSubDomains presentApplies to all subdomainsConfirm each has valid https
preload presentIntended for the preload listCheck you meet the requirements

How to fix it

First make sure https works everywhere: a valid certificate on the bare domain, www and every subdomain, and http redirecting to https. Then add the header. Where you add it depends on your platform.

Add the Strict-Transport-Security header
  1. Prefer a server-level setting

    On Apache add the header in .htaccess (snippet below); on nginx use the server block. Some hosts also offer an HSTS toggle in their dashboard or CDN.

  2. Or use a security plugin

    Some security and SSL plugins have an HSTS option. Check the max-age they set and whether includeSubDomains is on.

  3. Start with a short max-age

    Use 300 to 86400 seconds first, then raise it after testing.

nginx: add inside the https server blocknginx
add_header Strict-Transport-Security "max-age=86400" always;
Apache (.htaccess or vhost, needs mod_headers)htaccess
<IfModule mod_headers.c>
  Header always set Strict-Transport-Security "max-age=86400"
</IfModule>
Roll it out safely
  1. Fix https first

    Valid certificates on every host and http redirecting to https.

  2. Start with a short max-age

    For example 86400 (one day) without includeSubDomains.

  3. Test key journeys

    Load your forms, checkout, booking pages and any subdomains.

  4. Raise max-age in stages

    Move to a week, a month, then 31536000 (one year).

  5. Add includeSubDomains only when ready

    Every subdomain, including old and third-party hosted ones, must serve valid https.

  6. Treat preload as a separate decision

    Preload is hard to undo. Read the requirements on hstspreload.org before adding the preload token.

Header before and after

Before

  • No Strict-Transport-Security header
  • First visit can start on http
  • Or max-age=0 / a few seconds

After

  • Header sent on every https response
  • Browsers upgrade to https automatically
  • max-age raised in stages after testing

How to confirm it's fixed

Confirmation checks
  • curl -sI shows strict-transport-security on the bare domain and www
  • max-age is the value you intended
  • includeSubDomains is present only if every subdomain has valid https
  • Forms, checkout and booking pages still load on all hosts
  • http still redirects to https
  • A browser that visited before now upgrades http links to https without a request to http (DevTools shows an internal 307 redirect)

How to prevent it happening again

Prevention
  • Keep the header in server or CDN config, not in a one-off manual change
  • Re-run the curl check after a hosting move, CDN change or domain change
  • Before adding a new subdomain, issue its certificate first if includeSubDomains is on
  • Add certificate expiry dates to a calendar or monitor them
  • Document the chosen max-age and who can change it

How FunnelGuard handles this

FunnelGuard does not check HSTS yet. It is a possible future check. Today FunnelGuard runs your real customer journeys (lead forms, checkouts, booking and chat buttons) on a schedule from the EU or the US, so if a bad HSTS or https setup stops a page or form from loading, a failed step would show up in the journey, with a screenshot and a likely cause. That tells you something broke, not that HSTS is the reason by name.

To watch for HSTS itself, run the curl -sI check after every hosting, CDN or domain change, or use a free online header scanner on a schedule that suits you. You can also start with the free FunnelGuard plan (1 site, 2 journeys, daily checks, no card) to watch the journeys that matter most.

Questions people ask

What is HSTS and do I need it?

HSTS is the Strict-Transport-Security response header that tells browsers to use only https for your domain. You do not strictly need it for your site to work, but it is a recommended security setting and removes the insecure first http request for returning visitors.

Why is my HSTS header not showing?

The header may not be set at all, or it is only sent on http responses, where browsers ignore it. Check with curl -sI https://yourdomain.com and make sure your server, CDN or host adds it to https responses, including for www.

Does HSTS help SEO?

Not directly as a ranking factor. It helps by making sure visitors and crawlers reach the https version quickly and by reducing redirects for returning browsers, but it works best alongside correct redirects and a valid certificate.

What max-age should I use for HSTS?

Start with a short value such as 86400 (one day) while you test, then raise it in stages to 31536000 (one year). A long value is the usual goal, but it should only be set once https works on every host.

Is includeSubDomains safe to add?

Only if every subdomain, including old ones and ones hosted by third parties, serves valid https. If one does not, browsers will refuse to load it and visitors cannot click through the warning.

How do I remove HSTS if it broke my site?

Serve the header with max-age=0 over valid https so browsers drop the policy the next time they see it. Visitors who cached it will only clear it after receiving that header, so fix https first. Preloaded domains need a separate removal request.

Should I use HSTS preload?

Only if you are sure all your subdomains will stay on https long term. Preload puts your domain in lists shipped with browsers, and removal is slow. Review the requirements on hstspreload.org before adding it.

Does FunnelGuard check HSTS?

No, not yet. It is a possible future check. FunnelGuard does run your key journeys on a schedule, so a page that fails to load because of a bad https setup would show as a failed step, but you should check the header itself manually with curl.

Does FunnelGuard catch this?

Other tool

Needs a different kind of tool.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.