THE TAKEAWAYS

What to take away

  • An HSTS policy remains until it expires even after you remove the header. Start with a short max-age.
  • Before adding includeSubDomains, inventory every subdomain and confirm it answers correctly over HTTPS.
  • Do not send the HSTS header on HTTP responses; return only a permanent redirect to HTTPS.
  • Preload takes time to remove, so consider it only once long-term operations are settled.

FROM PRIMARY SOURCES

What HSTS promises

HSTS tells browsers that a host should from now on be reached only over HTTPS. According to MDN, when an HTTPS response includes the Strict-Transport-Security header, the browser adds the host's domain name to its list of HSTS hosts. After that, before loading an http URL for that host, the browser replaces the scheme with https.

The other important property is that users can no longer bypass certificate errors. MDN explains that if a TLS warning or an invalid certificate occurs when connecting to an HSTS host, the browser does not offer a way to click through the error. That protects users from a rogue access point intercepting traffic. It also means that if your own certificate renewal fails, nobody can get through either.

HSTS therefore strengthens protection while exposing operational mistakes directly to users. Adding the header takes minutes, but it commits you to keeping everything that follows, from certificate renewals and new subdomains to changes of outsourced service providers, answering correctly over HTTPS for years. Before deciding to introduce it, decide who will keep that commitment.

When asked about introducing it, first confirm that the site already serves every page over HTTPS and that there is a structure to keep doing so. HSTS is not a tool to finish the move to HTTPS but a tool to lock in the state after the move is complete. Adding it midway can stop users from opening pages that have not been moved yet. Not reversing that order is the first safeguard.

Sources: [1][2]

FROM PRIMARY SOURCES

Why it is hard to take back

HSTS is hard to undo because browsers store the policy with an expiry. MDN explains that every time the browser receives the header, it sets the expiry to the current time plus max-age. And if the header disappears from a host that previously sent it, the previous policy remains in effect until it expires. Removing the setting does not restore the old behaviour.

There is a way to disable it. RFC 6797 defines that a max-age value of zero signals the browser to stop treating the host as a Known HSTS Host. But as MDN notes, this only takes effect once the browser makes a secure request and receives the header in the response. By design, HSTS cannot be disabled over insecure HTTP.

So you cannot rescue a page that can no longer answer over HTTPS by disabling HSTS. If an internal admin screen runs only over HTTP on an old server and gets caught by the parent domain's includeSubDomains, there is no route to deliver the disabling header. You can only wait for the expiry stored in users' browsers or make that screen support HTTPS.

Operationally, it helps to read max-age as the longest time you may have to wait between noticing a mistake and recovering from it. Choosing one year means accepting that, in the worst case, the impact could last a year. That is why you extend the value while checking its effects rather than starting with a long one.

Note that the expiry differs for each user. Because it is counted from the last time the browser received the header, a user who visits every day and one who visited once six months ago keep the policy for different periods. Shortening or disabling the value reaches only users who visit the site again. Sharing in advance that the impact cannot be promised to end on a single date prevents confusion.

Sources: [1][2]

EDITORIAL PRACTICE

Inventory subdomains before widening the scope

With includeSubDomains, the policy applies to every subdomain of the domain. In MDN's example, a policy for secure.example.com with includeSubDomains also applies to login.secure.example.com and hosts below it, but not to the parent example.com or to insecure.example.com. How far it reaches depends on the name of the host that returned the header.

Before widening the scope, list the subdomains registered in DNS and check one by one that each answers correctly over HTTPS. Easy to miss are click-tracking hosts of email services, old campaign sites, internal admin screens, and aliases pointing to external booking systems or contact forms. Even hosts you do not operate are covered as long as they sit under your domain.

An inventory table with host name, purpose, operating company or owner, HTTPS support, certificate renewal method and retirement plan keeps the basis for decisions on record. If a host cannot support HTTPS, decide here whether to make it support HTTPS, retire it, or not use includeSubDomains. Proceeding with this unclear makes it impossible to explain the scope of impact later.

MDN says each subdomain should include the HSTS header in its own responses even if the parent domain uses includeSubDomains, because a browser may contact a subdomain before the parent. If links point directly to the www host, the browser may never see the parent's header. Do not stop at the parent; check that the header is returned by each major host.

The inventory is not something you build once. Once HSTS runs with a long-term value, every new subdomain must be served over HTTPS from the start. Treat the inventory as a document that must be updated whenever DNS changes or external service contracts are made, and record the date and owner of each update. An outdated table can no longer serve as the basis for the next decision on includeSubDomains or value changes.

Sources: [1]

EDITORIAL PRACTICE

Start max-age short and extend it in stages

In practice, it is easier to start with a short max-age and extend it each time you confirm there are no problems. For example, start with a few minutes to a day and check the main pages and the contact flow. Then move to a week, a month, and finally a long-term value. The length of each stage is up to your organisation, but write down in advance what you check at each stage and the conditions for moving on.

Keeping the impact small is easier if the first stage omits includeSubDomains and tests only the main hosts that return the header. After the inventory confirms every subdomain supports HTTPS, add includeSubDomains while keeping max-age short, and observe again. Not extending the value and widening the scope at the same time makes it easier to isolate the cause when something goes wrong.

Checks before each stage can use support enquiries, changes in drop-off in analytics, certificate expiry dates, and whether each CDN or load balancer returns the header. In setups with multiple CDNs or delivery routes, the header may be missing on some routes or old settings may linger. Record the header values by actually requesting each host over HTTPS and store them alongside the change log.

MDN notes that with a fixed max-age, each response pushes the expiry further into the future, so HSTS effectively never expires. After moving to the long-term value, that is the normal state. So before moving there, confirm that automatic certificate renewal, expiry monitoring and the HTTPS procedure for new subdomains are in place in a form that survives changes of staff.

Decide whether to move to the next stage by whether conditions are met, not by one person's feel. For example, require a set period at the previous stage without problems, recorded header values on every major host, and enough margin before certificate expiry. If the conditions are not met, investigate instead of extending the value and shorten it if necessary. Even then, assume that browsers which have already stored a long expiry will not see the change until their next visit.

Not stacking other large changes during a stage also makes isolation easier. If you extend the HSTS value at the same time as switching CDN, changing certificate issuer or moving servers, you will not know which one caused a problem. Put the HSTS stages in the change calendar and choose periods that do not overlap with other changes.

Sources: [1]

FROM PRIMARY SOURCES

Redirects from HTTP and the first connection

There are also rules about where the header is returned. RFC 6797 states that an HSTS host must not include the STS header field in HTTP responses conveyed over non-secure transport. MDN likewise says the host must send the header over HTTPS only, not HTTP. A header received over HTTP might have been altered in transit, so browsers ignore it.

If you accept HTTP requests, MDN recommends a permanent redirect such as 301 with an https URL in the Location header. Do not attach the HSTS header to that redirect. When the browser follows the redirect and requests again over HTTPS, include the header in that response. From then on, the browser connects over HTTPS from the start without waiting for the redirect.

A weakness still remains. According to MDN, HSTS does not take effect until the browser has made at least one secure connection to the host and received the header. When a first-time visitor opens an http URL, that first request is still exposed to interception. Old http URLs on external documents, business cards or old adverts make that first request more likely.

What operations can do is write every link you control with https, arrange redirects so they reach the correct host in a single hop, and check how redirects and the HSTS header are returned for each configuration. With chained redirects, an intermediate host may not return the header, or the chain may fall back to HTTP midway. Recording responses for each route reduces missed checks.

When checking, do not rely on the browser view alone. Browsers rewrite URLs according to the HSTS policy they have stored, so on your own machine you may not notice that the HTTP redirect is broken. From a fresh environment without the stored policy, or with command-line tools sending requests directly, confirm that HTTP responses return only the redirect and that HTTPS responses include the header.

Sources: [1][2]

FROM PRIMARY SOURCES

Decide on preload last

To cover the weakness of the first connection, there is a list of HSTS hosts built into browsers, known as preload. MDN explains that Google runs a service that accepts submissions to this list and that major browsers use it. It also says the list is not part of the HSTS specification and should not be treated as official.

Preload has conditions. According to MDN, when using preload, max-age must be at least one year and includeSubDomains must be present. Preload is therefore a decision to make the whole domain HTTPS-only for a long time. Because the list is distributed through browser updates, removing a domain later also takes time. It is safer not to apply without a period of short trials first.

Consider preload only after the subdomain inventory is finished, the long-term max-age has run without problems for a while, and the procedures for certificate renewal and new subdomains are established. Also check whether you might later need external services under your domain that cannot support HTTPS. Record who approved the decision, which conditions were met, and the procedure and impact should you want to remove it.

Before applying for preload, discuss with business owners what services might be used across the domain in future. If there are plans for sites of new offices or subsidiaries, or short-term event sites under your domain, you need a prospect that all of them can be served over HTTPS. Do not decide among technical staff alone; recording the agreement of departments that use the domain prevents later misunderstandings.

Sources: [1]

EDITORIAL PRACTICE

Make operations survive staff changes

With HSTS, the difference lies less in the configuration than in handing over the operations that follow. Keep one record with the reason for adding the header, the current max-age, whether includeSubDomains and preload are used, and the results of each stage. A new owner reading it should understand why the current value was chosen and what to confirm before changing it.

Day to day, check three things: certificate expiry and the results of automatic renewal, whether the main hosts return the header, and whether newly created subdomains support HTTPS. New subdomains in particular may be created suddenly for marketing or sales. Building the HTTPS and header checks into the DNS change procedure prevents oversights.

The record also helps when you hand work to an external developer or an overseas team. When requesting the work, state as conditions that changes to HSTS values follow the stages and checks, that HTTP responses never carry the header, and that responses before and after the change are recorded and shared. Judge completion not by the header being added but by the check records being complete.

Finally, prepare to explain HSTS decisions to people outside the team. When a partner asks why they cannot open a page, staff who do not know how certificates or HSTS work should still be able to respond first, so keep a short summary of common symptoms and check steps. Simply asking which host, since when and in which browser before contacting technical staff makes isolating the cause much faster.

Sources: [1]

EDITORIAL PRACTICE

A checklist to settle before rollout

Finally, here are the items to settle before starting, as a checklist. First, scope: the list of hosts that return the header and whether to use includeSubDomains. Second, the stage plan: max-age and duration for each stage and the conditions for moving on. Third, the rollback procedure: who decides to shorten the value or set max-age to 0 when problems occur, and through which route it is applied.

Fourth, the check method: which hosts are requested through which routes and where header and redirect results are recorded. Fifth, related operations: whether automatic certificate renewal, expiry monitoring, the DNS change procedure and the procedure for adding external services include HTTPS and header checks. Sixth, communication: which team receives enquiries when they increase and how they pass them to technical staff.

This checklist also serves as material for getting approval. Explaining only the benefits of HSTS makes it look entirely positive and invites hasty decisions. Placing the nature of the expiry, the conditions for disabling, the weakness of the first connection and the weight of preload in the same document lets approvers decide with an understanding of the responsibility they take on. After rollout, update the table whenever you change values or scope to keep a history of decisions.

Sources: [1][2]

WITH OPERUN.

Delegate everyday AI management.

HSTS can be started by adding one header, but because browsers remember the policy until it expires, mistakes take time to undo. Inventory your subdomains, extend max-age gradually from a short value, return only redirects on HTTP responses, and decide on preload once long-term operations are in place. With this order kept on record, you can keep the stronger protection and operate safely even when staff change.

Discuss your product and AI work

Primary sources

Sources checked on 17 November 2026. The workflows and checklists are editorial proposals.

  1. [1]
  2. [2]

Share this insight