Skip to main content
miji.be

HSTS

HTTP Strict Transport Security - a header that forces browsers to only connect to a website using HTTPS.

May 1, 2026 / About 1 min read

Security

HSTS (HTTP Strict Transport Security) is a web security mechanism that tells browsers to only communicate with a website using HTTPS, even if the user types "http://" or clicks an HTTP link. Once a browser receives an HSTS header, it automatically converts all future HTTP requests to HTTPS for the specified duration, preventing protocol downgrade attacks.

The HSTS header includes a max-age directive specifying how long the browser should remember the HTTPS-only policy, and optional includeSubDomains and preload directives. The preload directive allows the domain to be included in browsers' built-in HSTS preload lists, providing protection from the very first visit.

For URL shortening services, HSTS is essential because it ensures that all short URL clicks are handled over encrypted connections. Without HSTS, an attacker could intercept an HTTP request and redirect the user to a malicious site before the HTTPS upgrade occurs.

Deploying HSTS requires careful planning because mistakes can make a site inaccessible. Before enabling HSTS, ensure that all resources are available over HTTPS, all subdomains support HTTPS (if using includeSubDomains), and the certificate renewal process is reliable.

Was this article helpful?

Related Terms

HTTPS

The secure version of HTTP that encrypts data transmitted between a browser and a web server using TLS.

SSL/TLS

Cryptographic protocols that provide secure communication over the internet by encrypting data between client and server.

Certificate Transparency

A framework for monitoring and auditing SSL/TLS certificates to detect misissued or fraudulent certificates.

CORS

Cross-Origin Resource Sharing - a browser security mechanism that controls which domains can access resources from another domain.

CSP

Content Security Policy - an HTTP header that controls which resources a browser is allowed to load for a given page.

Referrer-Policy

An HTTP header that controls how much referrer information is included when navigating from one page to another.

Related Articles

Short URL Security - Phishing Risks, Safe Sharing Practices, and Protection Guide

A comprehensive guide to short URL security. Understand phishing risks, malware distribution via shortened links, and best practices for safe sharing.

Short URL Phishing - How to Spot Scams and Protect Yourself from Malicious Links

Learn to identify phishing attacks that use short URLs. Covers 5 common scam patterns, URL preview tools, and practical defense strategies.

Self-Hosting a URL Shortener: Full Link Control

Explore the benefits and challenges of running your own URL shortening service. Covers open-source tools, serverless architecture, and cost-performance tips.

FAQ

What are the benefits of enabling HSTS?
Browsers automatically upgrade HTTP requests to HTTPS, preventing man-in-the-middle and SSL stripping attacks. After the first visit, all connections are forced to use HTTPS.
What is the HSTS preload list?
It's a list of HSTS-enabled domains pre-registered in browsers. Once registered, HTTPS is enforced from the very first visit. You can submit your domain at hstspreload.org.

Put the terms to work

Shorten a URL for Free