Use this when forcing browsers to use HTTPS.
HSTS · Web Security
1. HSTS forces HTTPS after first visit.
2. max-age ≥ 1 year.
3. includeSubDomains once all subdomains have HTTPS.
4. Preload carefully.
5. Only send over HTTPS.
HTTPS response → HSTS → future requests HTTPS only
Context & applicabilityCommon mistakes · platform/version boundaries
- Setting
preloadbefore every subdomain supports HTTPS — removal from the preload list takes months. - Sending HSTS over HTTP (ignored by browsers).
- Very short
max-agethat gives little protection; aim for at least one year (max-age=31536000). - Forgetting that HSTS does not protect the very first visit unless the domain is preloaded.
Operational reference
Fast context before you go deeper.
curl -sI https://example.com | grep -i strict-transportVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Use max-age of at least a year.
- Add includeSubDomains when all subdomains use HTTPS.
- Preload is hard to undo.
ReferenceWhy it matters1 section · depth on demand
Rolling it out
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Start with a short max-age (for example 300) and increase it. includeSubDomains requires every subdomain to support HTTPS. Preloading (hstspreload.org) protects the very first visit but is hard to undo, so add it last.
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
HTTP Strict Transport Security (HSTS) tells browsers to use only HTTPS for a site for a set period, even if a user types http:// or follows an HTTP link. It closes the window where the first request could be intercepted and downgraded.
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Documented example, not captured output.
Rollout: start with a short max-age (e.g. 300 seconds), confirm all subdomains work over HTTPS, increase to a year, then consider includeSubDomains and preload list submission. Preloading is hard to undo — browsers ship the list — so only preload when every current and future subdomain will support HTTPS.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Web Security → HSTS. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://owasp.org/www-project-application-security-verification-standard/ · confidence 94%