Enforce HTTPS connections
Last updated Apr 17, 2026 Even with an active SSL/TLS certificate, visitors can still access resources over unsecured HTTP connections.
It is best to redirect this traffic over HTTPS, as well as ensure other resources (such as images) are also loaded over HTTPS.
Prerequisites
Before trying to enforce HTTPS connections, make sure that your application has an active edge certificate. Otherwise, visitors will not be able to access your application at all.
Also, make sure that your SSL encryption mode is not set to Off. Otherwise, Cloudflare will redirect all visitor connections automatically to HTTP.
1. Evaluate existing redirects
To make sure that your visitors do not get stuck in a redirect loop, evaluate existing redirects at your origin server and within the Cloudflare dashboard.
You should generally avoid redirects at your origin server. Not only are you likely to forget about them, but they also reduce application performance. It is much faster for Cloudflare to redirect requests before they ever reach your origin.
Make sure that your redirects within Cloudflare are not forwarding traffic to URLs starting with http.
2. Rewrite HTTP URLs
If your application contains links or references to HTTP URLs, your visitors might see mixed content errors when accessing an HTTPS page.
To avoid these issues, enable Automatic HTTPS Rewrites and pay attention to which HTTP requests are still reaching your origin server.
3. Redirect traffic to HTTPS
If your entire application can support HTTPS traffic, enable Always Use HTTPS.
If only some parts of your application can support HTTPS traffic, do not enable Always Use HTTPS and use a single redirect to selectively perform the redirect to HTTPS. Refer to Redirect admin area requests to HTTPS for an example.
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/ssl/edge-certificates/encrypt-visitor-traffic/#page","headline":"Enforce HTTPS connections","description":"Force all visitor traffic to use HTTPS connections.","url":"https://developers.cloudflare.com/ssl/edge-certificates/encrypt-visitor-traffic/","inLanguage":"en","image":"https://developers.cloudflare.com/ssl/edge-certificates/encrypt-visitor-traffic/og.png?v=c5720b48bcee270c","dateModified":"2026-04-17","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"},"keywords":["Redirects"]}
description: Control the geographic storage location of your private SSL/TLS keys. title: Geo Key Manager image: https://developers.cloudflare.com/ssl/edge-certificates/geokey-manager/og.png?v=e2117d6652c76bb5
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/ssl/llms.txt
Use this file to discover all available pages before exploring further.
Docs