HTTPS, SSL & Security
What is forced HTTPS?
Forced HTTPS is the practice of automatically redirecting all HTTP requests to the corresponding HTTPS version, ensuring that every visitor to a website connects securely regardless of whether they typed http:// or https:// in their browser, clicked an HTTP link, or arrived from an HTTP bookmark. When forced HTTPS is in place no HTTP version of any page is ever served, every HTTP request receives a redirect response pointing to the HTTPS equivalent.
The forcing in forced HTTPS refers to the removal of visitor choice, visitors cannot opt into HTTP even if they try. A visitor who explicitly types http://example.com is immediately redirected to https://example.com before any content is delivered. A crawler that follows an HTTP link to the site is redirected to HTTPS. An old bookmark using HTTP redirects to HTTPS on the next visit. HTTP access is not just unavailable, it is actively redirected to HTTPS.
Forced HTTPS is the implementation layer beneath HSTS: the server-side mechanism that catches HTTP requests and upgrades them. While HSTS instructs browsers to upgrade HTTP requests to HTTPS before they leave the device forced HTTPS handles the cases where HSTS is not yet in effect, first-time visitors, browsers that have not stored the HSTS policy, non-browser clients. Together forced HTTPS redirects and HSTS provide comprehensive coverage, forced HTTPS for all clients and HSTS for browsers that have previously visited.
Why forced HTTPS matters
Forcing HTTPS is not merely a best practice, it is the minimum baseline security requirement for any website that handles user data, accepts logins, processes payments, or simply wants to be trusted by modern browsers and search engines.
Security against network interception: HTTP traffic is transmitted in plaintext, visible to anyone who can observe the network path between the visitor and the server. An attacker on the same network, a public Wi-Fi operator, an ISP, a government surveillance system, a compromised router, can read every byte of HTTP traffic. Login credentials, form submissions, personal information, browsing history, all exposed in HTTP. Forcing HTTPS encrypts all traffic, observers see encrypted data they cannot read.
Protection against content injection: HTTP connections can be modified in transit, ISPs and network operators have injected advertisements, tracking scripts, and malware into HTTP responses. A visitor who reaches an HTTP page may see content that was never sent by the server, injected by an intermediary. HTTPS prevents this, the TLS integrity protection detects any modification of encrypted content in transit.
Browser security warnings: modern browsers, Chrome, Firefox, Edge, Safari, display explicit “Not Secure” warnings for HTTP pages. Chrome labels HTTP pages as Not Secure in the address bar. Firefox shows a crossed-out padlock. These warnings alarm visitors and reduce trust. Forcing HTTPS eliminates these warnings entirely, every page served over HTTPS shows the standard padlock rather than a security warning.
SEO ranking signal: Google has confirmed HTTPS as a ranking factor. A site that serves HTTP pages, even as a fallback, may have some pages evaluated as HTTP rather than HTTPS, receiving a weaker ranking signal. Forcing HTTPS ensures every URL Google crawls and indexes is HTTPS, maximising the ranking signal benefit and preventing HTTP versions of pages from competing with HTTPS versions in search results.
Canonical URL consistency: without forced HTTPS both HTTP and HTTPS versions of pages are technically accessible, creating duplicate content situations where the same page exists at two addresses. Forced HTTPS eliminates the HTTP versions, there is only one accessible URL for each page and it is HTTPS.
How forced HTTPS is implemented
Forced HTTPS is implemented through HTTP redirect rules that intercept all HTTP requests and return 301 permanent redirect responses pointing to the HTTPS equivalent.
Web server configuration: the most direct implementation. The web server listens on port 80, the standard HTTP port, and returns redirect responses for all requests. No content is served over HTTP, every request to port 80 receives a redirect to the HTTPS equivalent on port 443.
Nginx configuration:
nginx
This Nginx server block listens on port 80 for example.com and www.example.com and returns a 301 redirect to the HTTPS version of whatever URL was requested, $host preserves the host and $request_uri preserves the path and query string.
Apache configuration with.htaccess:
apache
The RewriteCond checks whether the connection is not HTTPS and the RewriteRule redirects all matching requests to the HTTPS equivalent.
Caddy, automatically forces HTTPS by default. No explicit configuration is needed, Caddy redirects HTTP to HTTPS automatically for any domain it is configured to serve.
Hosting platform settings: modern hosting platforms and CDNs provide forced HTTPS as a toggleable setting, enabling it in the platform’s dashboard enforces HTTP-to-HTTPS redirection without server configuration changes. Vercel, Netlify, AWS CloudFront, Cloudflare, and most other platforms offer this as a one-click option.
CDN and edge configuration: CDNs implementing forced HTTPS at the edge return redirect responses before requests ever reach the origin server, reducing load on the origin and providing the redirect from geographically distributed locations close to visitors.
Redirect management platforms: dedicated redirect management services handle HTTP-to-HTTPS redirection as part of their core functionality. When a domain is connected to a redirect management platform the platform handles both HTTP-to-HTTPS enforcement and all other configured redirect rules, providing a unified redirect layer for all traffic.
Forced HTTPS and redirect management
Forced HTTPS is a foundational component of any redirect management setup, the prerequisite that ensures all redirect traffic flows through HTTPS connections.
HTTP-to-HTTPS as the first redirect rule: in any redirect configuration HTTP-to-HTTPS enforcement should be the first rule applied to incoming requests. All HTTP requests are upgraded to HTTPS before any domain-specific or path-specific redirect rules are evaluated. This ensures that redirect rules are only applied to HTTPS requests and that redirect destinations are always HTTPS URLs.
Combining HTTP-to-HTTPS with other redirects: a common source of redirect chains is handling HTTP-to-HTTPS and other redirects, www to non-www, domain changes, as separate steps. A visitor arriving at http://www.old-domain.com might pass through:
http://www.old-domain.com→https://www.old-domain.com(HTTP to HTTPS)https://www.old-domain.com→https://old-domain.com(www to non-www)https://old-domain.com→https://new-domain.com(domain migration)
Three redirect hops where one would suffice. Combining all conditions into a single redirect rule, http://www.old-domain.com redirects directly to https://new-domain.com: eliminates the chain. Redirect management infrastructure that evaluates all conditions simultaneously and returns a single redirect response avoids chain creation.
SSL certificates required for HTTPS on redirect sources: forced HTTPS requires valid SSL certificates on the domains doing the forcing. When HTTP traffic arrives at a redirect source domain and is redirected to HTTPS the redirect itself is an HTTP response, no SSL is needed for the redirect response. However modern browsers increasingly attempt HTTPS first, even for HTTP URLs, meaning visitors may arrive at HTTPS on the redirect source domain before the redirect fires. If the redirect source domain has no SSL certificate these HTTPS attempts fail.
All redirect source domains should have valid SSL certificates even when they exist solely to issue redirects, ensuring that HTTPS visitors receive clean redirect responses rather than certificate errors.
HTTPS enforcement on connected domains: redirect management platforms that connect multiple domains typically enforce HTTPS on all connected domains automatically, both serving redirects over HTTPS and redirecting HTTP to HTTPS for every connected domain. This automatic enforcement eliminates the need for per-domain HTTP-to-HTTPS configuration.
Forced HTTPS and HSTS interaction
Forced HTTPS and HSTS are complementary security measures that together provide comprehensive HTTPS enforcement.
Forced HTTPS catches all requests: server-side forced HTTPS handles every HTTP request regardless of the client type. Browsers that have not stored an HSTS policy, first-time visitors, browsers that cleared their cache, non-browser clients, receive the HTTP-to-HTTPS redirect from the server. Forced HTTPS is the universal catch-all.
HSTS eliminates the redirect for returning visitors: once a browser has received and stored the HSTS header for a domain it upgrades HTTP requests to HTTPS internally, before making any network request. The browser never sends an HTTP request to the server and never needs the server-side redirect. HSTS eliminates the latency of the HTTP-to-HTTPS redirect for returning visitors.
The first-visit gap: forced HTTPS handles the first visit correctly, the visitor makes an HTTP request, receives the redirect, and follows it to HTTPS. During the initial HTTP request there is a brief window of vulnerability, the HTTP request itself is insecure. HSTS preloading closes this gap by ensuring browsers never make the HTTP request in the first place.
Layered security: the complete HTTPS enforcement stack is:
HSTS preload list — browsers never make HTTP requests to preloaded domains — maximum security for all visits
HSTS header — browsers store the policy after first HTTPS visit and enforce it for subsequent visits
Forced HTTPS redirect — server-side catch-all for any HTTP requests that reach the server
Each layer adds coverage, together they ensure every visitor connects via HTTPS.
Implementing forced HTTPS correctly
Use 301 permanent redirects: HTTP-to-HTTPS redirects should always be 301 permanent: not 302 temporary. Permanent redirects signal to browsers and search engines that HTTP is permanently replaced by HTTPS, browsers cache the redirect and search engines update their index to the HTTPS URL. Temporary redirects are not cached and do not consolidate SEO equity at the HTTPS URL.
Preserve the full URL path and query string: the redirect from HTTP to HTTPS must preserve the complete URL, not just redirect to the HTTPS homepage. http://example.com/products/item?id=123 must redirect to https://example.com/products/item?id=123: preserving the path /products/item and the query string ?id=123. Redirecting to the homepage loses the visitor’s intended destination and loses link juice from backlinks pointing to specific pages.
Handle both www and non-www: forced HTTPS must apply to both the www subdomain and the root domain. http://www.example.com must redirect to HTTPS. http://example.com must redirect to HTTPS. Incomplete implementation that only covers one variant leaves HTTP access available through the other.
Test all URL variants: after implementing forced HTTPS test each combination, http://example.com, http://www.example.com, http://example.com/specific-page, http://example.com/page?query=value. Verify each redirects to the correct HTTPS URL in a single hop.
Verify no redirect chains: use redirect checking tools to confirm that HTTP-to-HTTPS redirects complete in a single hop, not multiple redirects through intermediate HTTP or HTTPS URLs. Chains add latency and dilute SEO equity.
Common forced HTTPS mistakes
Redirect loops: misconfigured forced HTTPS that creates infinite redirect loops. A server configured to redirect HTTPS to HTTPS, perhaps because the redirect rule does not check whether the connection is already HTTPS, creates a loop. The request arrives at HTTPS, the redirect fires sending to HTTPS, the same redirect fires again. Browsers display ERR_TOO_MANY_REDIRECTS after following too many redirects.
Redirecting to HTTP destination: a forced HTTPS redirect that sends visitors to an HTTP URL, http://www.example.com instead of https://www.example.com. The browser immediately makes another HTTP request, potentially triggering another redirect. Verify that all redirect destinations in HTTP-to-HTTPS rules are HTTPS URLs.
Losing query parameters: redirect rules that drop query strings when upgrading from HTTP to HTTPS. A visitor to http://example.com/search?q=redirect+management is sent to https://example.com/search without the query, losing the search query. Redirect rules must explicitly preserve query strings.
HTTP-only on redirect source domains: implementing forced HTTPS on the primary domain but leaving redirect source domains, brand protection domains, legacy domains, without forced HTTPS. Visitors who arrive at these domains over HTTP are not upgraded to HTTPS, potentially encountering unsecured redirect responses. Forced HTTPS should apply to all domains in the redirect portfolio.
Not testing after hosting changes: forced HTTPS configuration on the server or hosting platform can be inadvertently disabled during platform migrations, hosting changes, or configuration updates. Testing HTTPS enforcement after any infrastructure change confirms the configuration remains active.