Your site worked until you put it behind Cloudflare or turned on HTTPS, and now browsers show ERR_TOO_MANY_REDIRECTS ("This page isn't working" in Chrome, "The page isn't redirecting properly" in Firefox). The page is stuck bouncing between two addresses, and the browser gives up after about 20 tries.
On a Cloudflare site, this is almost always one setting disagreeing with your server. Here's how to find which one and fix it.
First, rule out your own browser
Open the site in a private or incognito window. If it loads there, a stale cookie or cached redirect in your normal browser is the problem: clear cookies for the site and you're done. If it loops in a private window too, the site's configuration is the cause, and the rest of this guide applies.
Why the loop happens
With Cloudflare in front of your site, every request makes two trips: from the visitor to Cloudflare, then from Cloudflare to your server (the origin). The SSL/TLS encryption mode decides how Cloudflare makes that second trip.
| Mode | Cloudflare connects to your server over |
|---|---|
| Off | HTTP, and visitors get HTTP too |
| Flexible | HTTP, even when the visitor used HTTPS |
| Full | HTTPS, accepting any certificate |
| Full (strict) | HTTPS, requiring a valid certificate |
The classic loop is Flexible mode plus a server that forces HTTPS:
- A visitor requests
https://yourdomain.com. - Cloudflare, in Flexible mode, asks your server for
http://yourdomain.com. - Your server sees an HTTP request and redirects to
https://yourdomain.com. - The browser follows the redirect back to Cloudflare, and the cycle repeats.
Your server never sees HTTPS, so it never stops redirecting. The redirect might come from your web server config, an .htaccess rule, a hosting control panel's "force HTTPS" switch, or a WordPress plugin.
The fix: switch to Full (strict)
- In the Cloudflare dashboard, open your domain and go to SSL/TLS → Overview.
- Check the current encryption mode. If it says Flexible (or Off), that's your loop.
- Make sure your server has a certificate (see below), then select Configure, choose Custom SSL/TLS and set the mode to Full (strict).
- Reload the site in a private window. Changes apply within a minute or so.
Full (strict) fixes the loop because Cloudflare now connects over HTTPS, so your server's redirect never triggers. It also encrypts the trip between Cloudflare and your server, which Flexible never did.
If the Overview page says Automatic SSL/TLS, Cloudflare picked the mode itself, based on what your server supported when it checked. Choosing Custom SSL/TLS lets you set the mode yourself. Once your server has a valid certificate, you can switch back to Automatic if you prefer: it doesn't drop back to a weaker mode if that certificate later expires (Cloudflare's encryption mode docs). Some zones only show the Custom options.
If your server doesn't have a certificate
Full (strict) needs a valid certificate on your server. You have two free options:
- Your host's free certificate. Most hosts and control panels can issue a Let's Encrypt certificate with one click.
- A Cloudflare Origin CA certificate. Under SSL/TLS → Origin Server, Cloudflare issues a free certificate for your server that lasts up to 15 years. Browsers don't trust it directly, but they never see it: only Cloudflare does, and Cloudflare trusts it in Full (strict) mode.
Plain Full mode also stops the loop and accepts a self-signed or expired certificate, but it doesn't check that Cloudflare is talking to your real server. Use it only as a stopgap.
If you can't add a certificate at all
The other way to break the loop is to keep Flexible and remove every HTTPS redirect from your server, letting Cloudflare handle it with SSL/TLS → Edge Certificates → Always Use HTTPS. It works, but your traffic travels unencrypted between Cloudflare and your server. Treat it as temporary.
Other causes of the loop
- Your server redirects HTTPS back to HTTP. If Always Use HTTPS is on in Cloudflare and your server sends HTTPS visitors to HTTP, the two fight forever. Remove the server's redirect to HTTP.
- www and non-www disagree. A Cloudflare redirect rule sends
wwwto the bare domain while your server or app sends it back. Pick one version and redirect in only one place. - The app thinks it's on HTTP. Apps behind a proxy can't see the visitor's HTTPS connection unless they read the
X-Forwarded-Protoheader. WordPress is the common case: make sure the WordPress Address and Site Address settings both usehttps://, and that your setup honors that header. - Redirects in several places. HTTPS redirects in Cloudflare, in your web server and in your app can work alone but loop together. The durable fix is to force HTTPS in exactly one layer.
Still looping after the fix?
Browsers cache permanent (301 and 308) redirects, and they can keep replaying the old loop after you've fixed it. Test in a private window or a different browser, and clear cookies and cached data for the site before deciding the fix didn't work. If you use Cloudflare's cache, purge it under Caching → Configuration → Purge Everything.
From a computer, curl -sIL https://yourdomain.com lists every redirect in the chain, which shows exactly where the loop turns around.