On this page
What this issue is
HSTS is a header your server sends with https responses: Strict-Transport-Security. It tells the browser: for the next N seconds, never load this site over http. The browser upgrades the request to https itself, before anything goes over the network.
When the header is missing, your site may still work over https. But the browser has no memory that https is required. Every visit that starts with http:// (an old link, a typed domain, a printed URL) first reaches your server in plain text and only then gets redirected.
Why it costs you leads or sales
The risk is modest but real. On the first http request, someone on the same public Wi-Fi can read or change the traffic before the redirect happens. That can mean stripped redirects, injected content or stolen session cookies. A visitor who sees a browser warning on a form or checkout page often leaves.
There is also a small speed cost. Without HSTS, every http entry point costs an extra round trip to your server for the redirect. Security scanners, enterprise security reviews and some client audits also list a missing HSTS header as a finding, which can slow a deal.
- Visitor clicks http linkOld link, typed domain or printed URL
- Plain http requestSent unencrypted; can be read or changed
- Redirect to httpsOnly happens if the request survives
- Form or checkoutVisitor may never get a safe session
The first request goes out as plain http, which is the exposed step.
How to check if your site has it
Check the response headers of your https homepage. You are looking for a strict-transport-security line.
curl -sI https://www.example.com | grep -i strict-transport-securityNo output means the header is missing. In Chrome you can also open DevTools, go to the Network tab, reload, click the first request and read Response Headers. Test both the www and the apex (non-www) hostnames, and any checkout or booking subdomain.
| Result | Meaning | Action |
|---|---|---|
| No header | HSTS not enabled | Add it, starting with a short max-age |
| max-age=300 | Testing stage | Raise it once all is fine |
| max-age=31536000 | One year, the common long-term value | Good |
| max-age=0 | HSTS switched off | Set a real value |
How to fix it
Make sure https works everywhere
Every page, the www and apex hostnames, and any subdomain you plan to cover must load over https with a valid certificate. Redirect http to https first.
Add the header with a short max-age
Use
Strict-Transport-Security: max-age=300(5 minutes). Use the platform steps below.Test your key journeys
Load the homepage, forms, checkout and any subdomains in a browser and check for certificate errors.
Raise max-age gradually
Move to one day (86400), then one week (604800), then one year (31536000).
Consider includeSubDomains
Add it only when every subdomain is served over https. Add
preloadonly if you understand it: preload submission is hard to reverse.
Add it at the server
Best place is the web server config (see the Custom code tab for Apache and nginx). Without server access, a header plugin or your host's security settings may offer an HSTS option; check what your host provides.
Check for conflicts
Make sure two plugins or the host do not each add the header, which creates duplicates.
Check first
Shopify serves its storefront over https and manages the certificate. Run the curl check on your domain to see what is sent before changing anything.
You cannot edit server headers
Theme code cannot set HTTP response headers. If the header is missing on your domain, ask Shopify support; if you front the store with a CDN you control, set it there.
Look in Hosting settings
In Site settings, open Hosting and check the security options for HSTS. Availability depends on your plan, so check what your plan offers.
Verify with curl
After publishing, run the curl check on the live domain.
Check what is sent
Wix manages https and the headers itself. Run the curl check on your domain.
No header editing
You cannot set response headers in the Wix editor. If it matters for a client review, raise it with Wix support.
Use the built-in SSL setting
In Settings, open Advanced, then SSL, and make sure SSL is set to Secure (Recommended) so http is redirected.
Check the header
Run the curl check. Squarespace does not offer a header editor, so contact support if you need a specific value.
Check your custom domain
Run the curl check on the funnel or website domain. Headers are controlled by the platform.
Front it with a CDN if needed
If you put a CDN in front of the domain, set HSTS there (see Custom code).
Not the right tool
GTM runs in the browser and cannot set HTTP response headers. Set HSTS at the server, host or CDN.
nginx
Inside the https server block add: add_header Strict-Transport-Security "max-age=300" always; then reload nginx.
Apache
With mod_headers enabled, in the https virtual host or .htaccess add: Header always set Strict-Transport-Security "max-age=300".
CDN
In Cloudflare, open SSL/TLS, then Edge Certificates, then HTTP Strict Transport Security (HSTS) and enable it with a low max-age first.
server {
listen 443 ssl;
server_name www.example.com;
add_header Strict-Transport-Security "max-age=300" always;
}<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=31536000"
</IfModule>Before
- No Strict-Transport-Security header
- Browser starts on http for old links
- Relies on a redirect every time
After
- Header sent on every https response
- Browser upgrades to https by itself
- Redirect still in place as a backup
How to confirm it's fixed
- curl -sI shows strict-transport-security on the www hostname
- The apex hostname returns it too, or redirects to a host that does
- The header appears once, not duplicated
- Forms, checkout and booking pages still load over https
- Subdomains still load if you used includeSubDomains
- max-age is the value you intended
How to prevent it happening again
Headers are often lost when you change hosts, add a CDN or rebuild server config. Keep the HSTS line in your documented server or CDN config, not in a one-off manual edit. Re-run the curl check after any hosting, CDN or DNS change, and add it to your launch checklist for new sites and subdomains.
How FunnelGuard handles this
FunnelGuard does not check for a missing HSTS header today. It is a possible future check, not a current feature.
What FunnelGuard does do is run your real customer journeys (lead forms, checkouts, booking and chat buttons) on a schedule from the EU or the US and check each step. If a change to https settings breaks a page or form, that broken journey step is what the check can show, with a screenshot and a likely cause. It will not tell you the header is absent.
To watch for HSTS yourself, add the curl command above to a monthly checklist, or use a free online header scanner on your key hostnames after each hosting or CDN change.
Questions people ask
What does a missing HSTS header mean?
It means your server does not send a Strict-Transport-Security header, so browsers do not remember that your site must use https. Visits that start on http make one unprotected request before being redirected.
How do I add an HSTS header?
Add a Strict-Transport-Security header at your web server, host or CDN. In nginx use add_header, in Apache use Header always set, and in Cloudflare use the HSTS option under SSL/TLS, Edge Certificates. Start with max-age=300.
What max-age should I use for HSTS?
Start with 300 seconds while you test, then raise it to a day, a week and finally 31536000 (one year). One year is the common long-term value.
Can HSTS break my website?
Yes, if a covered hostname has no valid https setup. Browsers will refuse to load it over http and show an error. Start with a short max-age and only use includeSubDomains once every subdomain works on https.
Do I still need an http to https redirect if I use HSTS?
Yes. HSTS only applies after a browser has received the header over https once. The redirect handles first-time visitors, other clients and old links.
How do I check if HSTS is enabled on my site?
Run curl -sI https://yourdomain.com and look for a strict-transport-security line. You can also open Chrome DevTools, go to Network, click the first request and read the response headers.
Can I add HSTS in Shopify, Wix or Squarespace?
Usually not directly, because these platforms control response headers. Check what your domain sends with curl, and contact the platform's support if you need it changed.
Does FunnelGuard check for a missing HSTS header?
No, not yet. It is a possible future check. FunnelGuard currently runs your customer journeys and checks each step, so you would use curl or a header scanner for HSTS.
Related issues
- OPS-063HSTS too strict on a subdomain without HTTPSFix guide
- OPS-064HTTP not redirected to HTTPSFix guide
- OPS-065Redirect loop between http and https (CDN flexible SSL)Fix guide
- OPS-066Form posts to http endpoint from https pageFix guide
- OPS-060Weak protocols enabled (TLS 1.0/1.1, SSLv3)Fix guide
- OPS-053SSL certificate expiredFix guide