Insights

ERR_TOO_MANY_REDIRECTS After Turning On HTTPS? Check Your Cloudflare SSL Mode

November 28, 2026
0:00
You force HTTPS on your site, the SSL certificate looks perfectly valid, and yet every page throws ERR_TOO_MANY_REDIRECTS. The browser says the page "has been redirected too many times" and refuses to load anything. If your domain runs through Cloudflare, the most common cause is a mismatch between Cloudflare's SSL mode and your server's own HTTPS redirect rules.
When a browser follows a redirect, it lands on a new URL, which might redirect again. Browsers cap this at roughly 20 hops (the exact number varies). If the chain never reaches a final, non-redirecting response, the browser gives up and shows ERR_TOO_MANY_REDIRECTS (Chrome) or The page isn't redirecting properly (Firefox). This is not a certificate problem. The certificate can be completely valid and the loop still happens. The issue is that two pieces of your stack keep sending the request back and forth between HTTP and HTTPS, and neither one ever serves actual content.
Cloudflare sits between visitors and your server. Its SSL mode controls what happens on the back half of that connection, between Cloudflare and your origin server. In Flexible mode, Cloudflare accepts HTTPS from the visitor but connects to your server over plain HTTP on port 80. Your server sees an incoming HTTP request. If your server has a rule that says "redirect all HTTP to HTTPS" (via .htaccess, Nginx config, a WordPress plugin, or the CMS settings), it sends a 301 or 302 redirect back to the HTTPS version. Cloudflare receives that redirect, follows it, and connects to your server over HTTP again, because Flexible mode always uses HTTP to the origin. Your server redirects again. Loop. The sequence looks like this:
  1. Visitor requests https://example.com (hits Cloudflare).
  2. Cloudflare connects to origin at http://example.com (Flexible mode).
  3. Origin sees HTTP, sends 301 redirect to https://example.com.
  4. Cloudflare follows the redirect, connects to origin at http://example.com again.
  5. Origin sends another 301. Repeat until the browser gives up.
This is by far the most common cause of redirect loops on Cloudflare-proxied domains. It catches people because everything looks correct in isolation: the certificate is valid, the redirect rule is sensible, and Cloudflare is "working." The conflict only appears when the two layers interact. For a deeper look at why this specifically breaks WordPress sites, there is a related walkthrough here: Cloudflare Flexible SSL Isn't End-to-End, and It Causes WordPress Redirect Loops.
Before guessing at fixes, confirm what is actually happening. Use curl with the -IL flags to follow redirects and print only the response headers. This shows you the exact chain.
BASH
curl -IL https://example.com 2>&1 | grep -i 'HTTP/\|location:'
Illustrative output format:
TEXT
HTTP/2 301
location: https://example.com/
HTTP/2 301
location: https://example.com/
HTTP/2 301
location: https://example.com/
If you see the same location: URL repeating, that confirms a loop. The redirect target never changes, which means the request keeps bouncing between the same two states. You can also add -v for verbose output to see whether Cloudflare headers like cf-ray or server: cloudflare are present, which confirms the request is going through Cloudflare's proxy. One thing to watch for: your browser caches 301 redirects aggressively. If you already tested in a browser, clear the cache or use a private/incognito window after making changes. Old cached redirects will make it look like nothing changed even after you fix the server.
There are two directions you can go, and which one is correct depends on whether your origin server has a valid SSL certificate installed.
If your origin server already has a valid SSL certificate (from Let's Encrypt, a paid CA, or a Cloudflare Origin CA certificate), switch the SSL mode in the Cloudflare dashboard from Flexible to Full (Strict). This tells Cloudflare to connect to your origin over HTTPS on port 443. Now when your server receives the request, it arrives over HTTPS. Your server's "redirect HTTP to HTTPS" rule does not fire because the request is already HTTPS. No loop. Full (Strict) validates the origin certificate against a trusted CA. Full (without Strict) connects over HTTPS but does not validate the certificate, which means a self-signed or expired cert would still work. Full (Strict) is the better choice for production sites because it gives you actual end-to-end encryption with certificate validation. After switching, wait a minute or two and test with curl again. You should see a single HTTP/2 200 instead of a chain of 301s.
If you cannot install a certificate on the origin (some legacy setups, certain shared hosting plans), you can keep Flexible mode but remove every rule that redirects HTTP to HTTPS on the server side. Cloudflare's "Always Use HTTPS" setting in the dashboard handles the visitor-facing redirect at the edge, so your origin does not need to do it. This means the connection between Cloudflare and your server is unencrypted. That is a real trade-off: anyone who can see traffic between Cloudflare's edge and your server (your hosting provider's network, for example) can read it in plain text. For most sites, installing a free certificate and using Full (Strict) is the better path.
The redirect that causes the loop can live in several places. If you switched Cloudflare to Full (Strict) and the loop stopped, you are done. But if you chose Option B and need to find and remove the redirect, check these locations:
  • .htaccess (Apache/LiteSpeed): Look for RewriteRule lines that check %{HTTPS} off or %{SERVER_PORT} 80 and redirect to https://. There may be multiple .htaccess files in subdirectories.
  • Nginx config: Look for return 301 https://hostrequest_uri; or if ($scheme = http) blocks in your server block for port 80.
  • WordPress settings: The siteurl and home values in wp_options (database) or in wp-config.php. If both are set to https://, WordPress itself will try to enforce HTTPS. A plugin like Really Simple SSL or a security plugin may also add redirect logic.
  • Cloudflare Page Rules or redirect rules: A page rule with "Always Use HTTPS" or a bulk redirect rule can add another layer of redirection. If your origin is also redirecting, you can end up with a double redirect (not a loop, but unnecessary hops).
  • cPanel "Force HTTPS Redirect": cPanel has a toggle in the Domains section that injects an .htaccess redirect. Turning it off removes the rule.
The tricky cases involve multiple redirect sources stacked on top of each other. A WordPress plugin forces HTTPS, .htaccess also forces HTTPS, and Cloudflare's Always Use HTTPS is on. With Full (Strict) mode, all three are harmless (the request is already HTTPS by the time it hits the origin). With Flexible mode, any one of the server-side rules creates the loop.
After making changes, run the same curl command:
BASH
curl -IL https://example.com 2>&1 | grep -i 'HTTP/\|location:'
You want to see either a single HTTP/2 200 or at most one redirect (for example, from https://example.com to https://www.example.com) followed by a 200. If you still see a repeating chain, something is still redirecting on the origin side. Also test in a fresh incognito browser window. If curl shows a clean 200 but your regular browser still loops, the browser has a cached 301. Clear the browser cache for that domain or wait for the cache to expire.
When Cloudflare's SSL mode is set to Flexible, it talks to your origin over HTTP. If your origin redirects HTTP to HTTPS, the request bounces forever. The fix is almost always to switch Cloudflare to Full (Strict) and make sure your origin has a valid certificate. That gives you real end-to-end encryption and eliminates the redirect conflict in one step. If you are troubleshooting and not sure where the redirect is coming from, curl -IL shows you the exact chain before you start changing settings.

Join My Newsletter & Get Updates!

Get notified whenever a new technical guide, server infrastructure breakdown, or personal reflection goes live, plus a curated weekly digest.