Decide whether to add includeSubDomains on Cloudflare
Why it matters
Without includeSubDomains, subdomains are not forced onto HTTPS by the main domain's policy. Adding it is a choice because it also locks every subdomain, including old or internal ones, to HTTPS.
Risky change. A wrong setting here can take your site or your mail offline. Follow the stages in order, test each one, and keep a way back.
The fix
- Do the subdomain audit from the generic steps first.
- Open SSL/TLS then Edge Certificates then HSTS and switch on Apply HSTS policy to subdomains (includeSubDomains), then choose the Max Age. Cloudflare's documentation lists max-age options starting at one month, which is a long commitment. For a shorter test, leave the built-in HSTS setting off and set the header with a Response Header Transform Rule instead (Rules then Overview then Create rule), with value max-age=300; includeSubDomains. Delete the rule and use the dashboard setting only once you are sure, and never run both at once.
- Keep every subdomain on HTTPS afterwards. Cloudflare warns that turning off HTTPS while HSTS is active can make the site unreachable.
Related
Scan your domain to see whether this applies to you.