Pilotiko feature : available

HTTPS and HSTS: how do you enforce secure connections to your website?

The padlock in the address bar, followed by the rule that stops anyone from slipping back.

HTTPS is the encrypted version of the web protocol: traffic between the browser and your site travels over a secure connection. HSTS (HTTP Strict Transport Security) is a Strict-Transport-Security response header telling browsers to use only HTTPS for that domain for a set period, and to refuse any click-through on certificate errors.

Try 30 days free

30 days free, no credit card.

By Pilotiko editorial team · Updated on

In short

  • HSTS is defined in IETF RFC 6797, published in November 2012.
  • Browsers ignore a Strict-Transport-Security header received over plain HTTP.
  • max-age sets, in seconds, how long the browser remembers the rule.
  • The preload list requires a max-age of at least 31,536,000 seconds (one year) and includeSubDomains.
  • Google has used HTTPS as a lightweight ranking signal since 2014.

Why isn't HTTPS enough without HSTS?

An HTTPS site normally redirects anyone typing http:// to the secure version. The weak spot is that very first unencrypted exchange. The HSTS preload project explains that an on-path attacker, on public Wi-Fi for instance, can intercept and rewrite that redirect to keep the browser on plain HTTP, or inject cookies into the redirect response [4].

HSTS closes the gap. RFC 6797 defines a mechanism letting a site declare itself reachable only over secure connections [2]. Once the browser has the header, it rewrites http to https for that domain on its own and stops offering users a way past certificate errors [1]. The RFC also says a request received over plain HTTP should get a permanent redirect, such as a 301, to HTTPS [2].

How do you read the Strict-Transport-Security header?

MDN spells out a few mechanics: the host is identified by domain name only (never an IP address), the rule covers every port, and each new copy of the header pushes expiry out by adding max-age to the current time [1]. Crucially, the header must arrive over HTTPS; sent over HTTP it is ignored, so an attacker can't tamper with it [1].

Directives of the Strict-Transport-Security header
DirectivePurposeWorth knowing
max-age=<seconds>How long the browser remembers the ruleRequired; refreshed with every response received
includeSubDomainsExtends the rule to every subdomainOptional, but mandatory for preloading
preloadRequests inclusion on the preload listOptional; needs max-age ≥ 31,536,000 and includeSubDomains

Sources: MDN [1] and hstspreload.org [4].

How do you turn on HSTS without breaking a subdomain?

What is the HSTS preload list?

A browser only learns a site's HSTS policy after a first visit. To cover that first load, Chrome ships a built-in list of domains that are only ever contacted over HTTPS, and Firefox, Safari and Edge have lists based on Chrome's [4].

To qualify you need a valid certificate, a redirect from HTTP to HTTPS on the same host, every subdomain on HTTPS (including www if it exists), and a header with max-age of at least 31,536,000 seconds, includeSubDomains and preload [4]. The site warns that removal tends to be slow and painful [4]. For most small businesses, preloading isn't urgent; a well-tested HSTS header already protects returning visitors.

Does HTTPS help with SEO?

A little. In August 2014, Google announced it was starting to use HTTPS as a ranking signal, noting that the signal carried very little weight at first and might be strengthened over time [3]. So it is no magic SEO lever, but it is the baseline expected of any business site. For a quote-request form that collects personal information, encryption is also a sensible safeguard in the spirit of Quebec's Law 25.

Which HTTPS and HSTS mistakes should you avoid?

  • Turning on includeSubDomains without checking every subdomain, including internal ones that aren't public [4].
  • Starting straight at a one- or two-year max-age, so any misconfiguration stays cached in browsers for that whole period.
  • Sending the header only over HTTP, where browsers ignore it [1].
  • Adding preload “just to try it”; getting off the list is slow [4].
  • Letting the certificate lapse: with HSTS, visitors can no longer click past the warning [1].
  • Leaving images or scripts loaded over http:// in your pages; the upgrade-insecure-requests directive of a Content Security Policy can help.

What does Pilotiko do with HTTPS and HSTS?

The audit of your current site checks whether the home page is served over HTTPS and treats its absence as a critical issue. HSTS configuration for your own domain isn't among the advertised features of the hosted site, so check it with whoever manages your domain name before enabling includeSubDomains or preload.

Frequently asked questions

What is the difference between HTTPS and HSTS?

HTTPS encrypts the connection. HSTS is a rule the site sends that forces the browser to use HTTPS for that domain for the max-age period, even if someone types http://. One doesn't replace the other.

What max-age value should I use?

Start small, such as 300 seconds, then step up to a month while checking that nothing breaks. The preload list requires at least 31,536,000 seconds, which is one year.

Is HSTS mandatory?

No, it is an extra layer of protection. RFC 6797 describes it as a policy the site declares for itself. For a site that collects information through forms, it is a sensible step once HTTPS works everywhere.

What happens if my certificate expires while HSTS is on?

The browser shows an error and won't let users click through. The site stays unreachable until the certificate is renewed, so keep an eye on the expiry date.

Should I submit my domain to the preload list?

Most small businesses don't need to. Preloading protects the very first visit, but it imposes strict conditions on every subdomain and is hard to undo.

Sources

  1. MDN Web Docs, Strict-Transport-Security header (accessed on October 15, 2026).
  2. IETF, RFC 6797 : HTTP Strict Transport Security (HSTS) (accessed on October 15, 2026).
  3. Google Search Central Blog, HTTPS as a ranking signal (accessed on October 15, 2026).
  4. hstspreload.org (projet Chromium), HSTS Preload List Submission (accessed on October 15, 2026).

Your whole business, on one screen.

Each department is a room. Pilotiko prepares the work; you approve with one click.

Try 30 days free

The Pilotiko office of a sample company: each department is a room.
  • Call answered
  • Appointment confirmed
  • Email reply ready
  • Invoice prepared

Try the office with your team

30 days free.

Try 30 days free