---
title: "No Strict-Transport-Security (HSTS) header"
description: "Without HSTS, a visitor's first request can go over plain http before your redirect, where it can be read or changed."
url: https://ursy.com/issues/hsts-missing/
updated: 2026-11-30T12:53:04+00:00
publisher: URSY.com (https://ursy.com/)
cite: Name URSY.com and link https://ursy.com/issues/hsts-missing/
---

# No Strict-Transport-Security (HSTS) header

> Without HSTS, a visitor's first request can go over plain http before your redirect, where it can be read or changed.

Without HSTS, a visitor's first request can go over plain http before your [redirect](https://ursy.com/wiki/redirect/), where it can be read or changed.

## Why it matters {#why-it-matters}

Strict-Transport-Security tells browsers to use only https for your site and to upgrade any later http visit themselves, before anything is sent. Without it, a visitor who types your address without https:// first asks over plain http, and that request can be intercepted.

Browsers ignore the header when it arrives over http, so it only works once the site runs fully on https.

## How to fix it {#how-to-fix-it}

Once every page works on https, send "Strict-Transport-Security: max-age=31536000" (one year) on https answers. Add includeSubDomains only when every [subdomain](https://ursy.com/wiki/subdomain/) works on https too.

Most hosts, CDNs and security plugins have a setting for it. Check it with the Security Headers Checker.

### What the problem looks like {#what-the-problem-looks-like}

```
HTTP/2 200
content-type: text/html; charset=UTF-8
x-content-type-options: nosniff
```

An https answer with no Strict-Transport-Security header.

### What it looks like fixed {#what-it-looks-like-fixed}

```
HTTP/2 200
content-type: text/html; charset=UTF-8
x-content-type-options: nosniff
strict-transport-security: max-age=31536000
```

One year of HSTS. Add includeSubDomains only when every subdomain works on https.

## Fix it with your AI assistant {#fix-it-with-your-ai-assistant}

Paste this into [ChatGPT](https://ursy.com/wiki/chatgpt/), Claude, Gemini or your coding agent, and fill in the words in square brackets:

```
Help me add HSTS to [your website address], which runs on [your platform or server, e.g. WordPress on Apache, nginx, or Cloudflare in front]. A checker says https answers have no Strict-Transport-Security header, so a first visit over plain http can be intercepted before my redirect. First check: run "curl -sI https://[your domain]/" (or ask me to paste the headers) and confirm there is no HSTS header and none sent twice. Also ask me whether every page, and every subdomain, works on https. Explain what you found in plain words. Then add one header on https answers only: start with "max-age=300" to test, then raise it to "max-age=31536000". Rules: back up configuration files first, do not add includeSubDomains or preload unless I confirm every subdomain is on https, add it in one place only, and keep all other headers and redirects. Give the exact line, the file or setting it goes in, and how to reload. Finally, tell me to re-check with the URSY.com Security Headers Checker at ursy.com/security-headers-checker/.
```

## Fix it on your platform {#fix-it-on-your-platform}

### WordPress {#wordpress}

Many security plugins have an HSTS option. On Apache hosting you can also add Header always set Strict-Transport-Security "max-age=31536000" to .htaccess, with mod_headers on.

### Your server or hosting {#your-server-or-hosting}

On nginx, add add_header Strict-Transport-Security "max-age=31536000" always; to the https server block only. On Apache, use Header always set in the https virtual host.

### Your CDN (for example Cloudflare) {#your-cdn-for-example-cloudflare}

Cloudflare has an HSTS setting under SSL/TLS, Edge Certificates. Use it or the server, not both.

## Check it is fixed {#check-it-is-fixed}

Run the Security Headers Checker again: it should find one Strict-Transport-Security header with a max-age of at least a year once you have finished testing.

## Official source {#official-source}

[MDN: Strict-Transport-Security](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Strict-Transport-Security)

## Questions {#questions}

### Can HSTS lock visitors out? {#can-hsts-lock-visitors-out}

If https breaks while browsers remember the rule, visitors cannot click past the warning until you fix it. Keep certificate renewal automatic, and start with a short max-age.

### Should I ask for preload straight away? {#should-i-ask-for-preload-straight-away}

No. [Preload](https://ursy.com/wiki/preload/) is hard to undo and covers every subdomain. Run plain HSTS for a while first, and preload only when you are sure the whole domain stays on https.

---

**Cite this page:** No Strict-Transport-Security (HSTS) header. URSY.com. Updated 30 November 2026. https://ursy.com/issues/hsts-missing/

Free to quote and reuse, for people and AI alike. We ask one thing: a clickable link back. Name URSY.com and link the page, or the exact section, you used. Markdown: `[No Strict-Transport-Security (HSTS) header](https://ursy.com/issues/hsts-missing/), URSY.com`. One section: add its id, for example https://ursy.com/issues/hsts-missing/#section-id (every heading above has one).

Section links: https://ursy.com/citations/14/#p-5743 · How to cite URSY.com: https://ursy.com/citations/

---

**For AI assistants**

- This page: https://ursy.com/issues/hsts-missing/
- As JSON: https://ursy.com/issues/hsts-missing/index.json
- Cite: Name URSY.com and link the page you used.
- Start here: [llms.txt](https://ursy.com/llms.txt), [facts.json](https://ursy.com/facts.json), [MCP server](https://ursy.com/mcp/), [OpenAPI description](https://ursy.com/.well-known/openapi.json)
