
Cloudflare “too many redirects” errors almost always mean Cloudflare and your server disagree about HTTPS. The classic case: Cloudflare’s SSL mode is set to Flexible, so it talks to your server over plain HTTP, and your server (or WordPress) keeps redirecting that HTTP request to HTTPS. Set SSL/TLS > Overview to Full (strict) if your host has a valid SSL certificate, clear your browser cookies, and the loop stops.
You turn on Cloudflare, or change one setting, and suddenly the site won’t load. Chrome shows ERR_TOO_MANY_REDIRECTS and “This page isn’t working. example.com redirected you too many times.” Firefox calls it “The page isn’t redirecting properly.” Sometimes the front end works and only /wp-admin/ loops.
The good news: the cause of the Cloudflare too many redirects error is nearly always one of four settings, and you can find the right one in a few minutes. On client sites we’ve seen it most often right after moving DNS to Cloudflare, when the default SSL mode meets a host that already forces HTTPS.
This guide shows you how the loop happens, how to confirm which layer is causing it, and the exact fix for WordPress, cPanel and other hosts.
Why Cloudflare causes a redirect loop
When Cloudflare’s proxy is on (the orange cloud in DNS), there are two connections, not one:
- Visitor to CloudflareThe browser asks for https://example.com. This part is encrypted.
- Cloudflare to your serverIn Flexible mode, Cloudflare requests http://example.com (no encryption).
- Your server repliesIt sees an HTTP request and answers “301, go to https://example.com”.
- Cloudflare passes it backThe browser follows the redirect to HTTPS, which lands at step 1 again.
The browser gives up after about 20 hops and shows ERR_TOO_MANY_REDIRECTS.
Cloudflare’s own troubleshooting page says it plainly: in Flexible mode, “redirect loops will occur if your origin server automatically redirects all HTTP requests to HTTPS.” Your server never sees HTTPS, so it keeps asking for it.
The reverse can happen too. In Full or Full (strict) mode, Cloudflare connects over HTTPS, and if your server forces everything back to HTTP, you get the same loop from the other direction.
Cloudflare SSL modes explained (Flexible vs Full vs Full strict)
Most loops come down to picking the wrong encryption mode, so it helps to know what each one does. You’ll find them in the Cloudflare dashboard under your domain, then SSL/TLS > Overview.
| Mode | Cloudflare to your server | Needs a certificate on your host? | Redirect loop risk |
|---|---|---|---|
| Off | No HTTPS anywhere | No | High if HSTS or HTTPS redirects are on |
| Flexible | Always plain HTTP | No | High if your host or WordPress forces HTTPS |
| Full | Matches the visitor (HTTPS to HTTPS) | Yes, but self-signed is accepted | Low |
| Full (strict) | HTTPS, certificate is validated | Yes, valid (Let’s Encrypt, AutoSSL or Cloudflare Origin CA) | Low |
| Strict (SSL-Only Origin Pull) | Always HTTPS, validated, even for HTTP visitors | Yes, valid | Low |
Cloudflare also offers Automatic SSL/TLS, which scans your origin (roughly monthly, per Cloudflare’s docs) and picks the most secure mode that works. It’s a sensible default for new sites, but if you’re mid-fix, choose a mode manually so you know exactly what’s set.
Flexible mode leaves the connection between Cloudflare and your server unencrypted. Visitors see a padlock, but form submissions and logins travel in plain text for that second leg. If your host can give you a certificate (almost every host can now), use Full (strict).
Step 1: Confirm where the loop is coming from
Before changing anything, spend one minute confirming the loop. It saves guessing.
Check the redirect chain
If you’re comfortable with a terminal, run this (it works on macOS, Linux and Windows 10/11):
curl -sIL --max-redirs 5 https://example.com
You’ll see each response’s status and Location header. If the same URL appears over and over with 301 or 302, and the Location keeps pointing at https://example.com/, it’s the Flexible SSL loop. If it bounces between http:// and https://, something is forcing HTTP.
No terminal? Open Chrome DevTools (F12), go to the Network tab, tick Preserve log, and reload. You’ll see the repeated 301s in a list.
Pause Cloudflare as a quick test
In the Cloudflare dashboard, open your domain’s Overview page and find Pause Cloudflare on Site. Wait a few minutes and test the site in a private window. If it loads fine without Cloudflare, the problem is the Cloudflare and server combination, not WordPress on its own. Remember to resume Cloudflare afterwards.
Step 2: Fix the SSL mode (the fix for most sites)
This is the fix for the majority of Cloudflare too many redirects errors.
- Make sure your host has a valid SSL certificate for the domain. On cPanel, check Security > SSL/TLS Status. Most hosts issue a free one through AutoSSL or Let’s Encrypt.
- In Cloudflare, go to your domain, then SSL/TLS > Overview.
- Choose Full (strict). If your host only has a self-signed certificate, choose Full for now.
- Save, wait a minute, then clear cookies for the site (or use a private window). Browsers cache 301 redirects, so an old loop can stick around after the fix.
- Load the home page and
/wp-admin/to confirm both work.
Don’t switch to Full (strict) if your host has no certificate at all. Cloudflare will fail to validate the origin and show a 526 “Invalid SSL certificate” error instead. Get a certificate installed first, or use a free Cloudflare Origin CA certificate (created under SSL/TLS > Origin Server > Create Certificate) and install it on your host.
On client sites we’ve seen cPanel AutoSSL fail to renew once the domain is proxied through Cloudflare. If that happens, a free Cloudflare Origin CA certificate (you pick a long validity period when you create it) keeps Full (strict) working without relying on AutoSSL.
Step 3: Stuck on Flexible? Stop the server forcing HTTPS
Some cheap hosts or old servers can’t serve HTTPS at all. If you must stay on Flexible, the server and WordPress need to stop redirecting to HTTPS themselves, and let Cloudflare do it.
Turn off host-level HTTPS redirects
- cPanel: go to Domains and switch off the Force HTTPS Redirect toggle for the domain.
- .htaccess: look for rules like
RewriteCond %{HTTPS} offfollowed byRewriteRule ... https://and comment them out. Take a backup of the file first. - Plugins: SSL plugins and some security plugins add their own HTTPS redirect. Check their settings and turn that option off.
Tell WordPress the visitor is on HTTPS
WordPress decides whether a request is secure by looking at the server’s HTTPS flag. Behind Flexible SSL, that flag is always off. WordPress’s own documentation warns that behind a reverse proxy that handles SSL, forcing HTTPS “will initially send any requests into an infinite redirect loop.”
The official fix is to add this to wp-config.php, above the line that says /* That's all, stop editing! */:
if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && strpos( $_SERVER['HTTP_X_FORWARDED_PROTO'], 'https' ) !== false ) { $_SERVER['HTTPS'] = 'on'; }
Cloudflare sends the X-Forwarded-Proto header with every proxied request, so WordPress now knows the visitor is really on HTTPS. We’ve added an isset() check to the WordPress.org example so it doesn’t throw a warning when the site is accessed directly without Cloudflare.
The Flexible SSL for CloudFlare plugin does the same job if you’d rather not edit files. It’s only needed for Flexible mode, and you should remove it once you move to Full.
Full (strict) with a certificate
- Encrypted all the way to your server
- No wp-config or plugin workarounds
- Host redirects can stay on
Flexible with workarounds
- Cloudflare-to-server leg is plain HTTP
- Needs host redirects turned off
- Breaks again if someone re-enables Force HTTPS
Other causes: Always Use HTTPS, HSTS and redirect rules
If your SSL mode is already Full or Full (strict) and the loop continues, work through these.
Always Use HTTPS plus a server that forces HTTP
SSL/TLS > Edge Certificates > Always Use HTTPS sends every HTTP request to HTTPS. If your server or WordPress redirects HTTPS back to HTTP, you get a loop. Check Settings > General in WordPress: both WordPress Address (URL) and Site Address (URL) should start with https://. If they’re greyed out, they’re set by WP_HOME and WP_SITEURL in wp-config.php.
HSTS
HSTS tells browsers to only ever use HTTPS. If it’s on and your SSL mode is Off, or your server redirects to HTTP, the site will loop. Cloudflare’s advice is to keep the mode at Flexible or higher and remove any HTTP redirects on your server. Be careful turning HSTS off: browsers remember it for the max-age you set, so the change doesn’t take effect for returning visitors straight away.
Redirect Rules and Page Rules
Go to Rules in the Cloudflare dashboard and look at Redirect Rules and any old Page Rules. A rule that sends www to the root domain, combined with a WordPress setting that uses www, will bounce visitors back and forth forever. Make sure the rule and your WordPress Site Address agree on one version.
| What you see | Likely cause | Fix |
|---|---|---|
| Loop on every page, SSL mode is Flexible | Host or WordPress forces HTTPS | Switch to Full (strict) |
| Only /wp-admin/ loops | FORCE_SSL_ADMIN behind Flexible |
Full (strict), or add the X-Forwarded-Proto snippet |
| Bounces between http and https | Server or Site Address uses http:// | Set both WordPress URLs to https:// |
| Bounces between www and non-www | Redirect Rule disagrees with WordPress | Pick one version everywhere |
| Fixed for others, not for you | Cached 301 in your browser | Clear cookies and cache, or use a private window |
After the fix: clear caches
Redirects get cached in several places. Once the site loads in a private window, purge Cloudflare’s cache under Caching > Configuration > Purge Everything, then clear any WordPress caching plugin. Our guide to clearing WordPress and Elementor caches in the right order walks through each layer.
If you just moved DNS to Cloudflare, it’s also worth sending a test email from your contact form. MX records that were missed during the move are a common side effect, and our post on fixing WordPress contact form emails with SMTP covers how to test delivery properly.
The Cloudflare too many redirects error is a disagreement about HTTPS between Cloudflare and your server. Put a valid certificate on your host, set Cloudflare to Full (strict), clear your browser cookies, and it’s fixed for most sites. Only stay on Flexible if your host can’t do HTTPS, and then turn off every server-side HTTPS redirect.
Frequently asked questions
Should I use Flexible or Full SSL on Cloudflare?
Use Full (strict) whenever your host has a valid certificate. Flexible only encrypts the visitor-to-Cloudflare leg and is the most common cause of redirect loops with WordPress.
Why does only wp-admin say too many redirects?
WordPress forces HTTPS for the dashboard when FORCE_SSL_ADMIN is on. Behind Flexible SSL, WordPress never sees HTTPS, so it keeps redirecting. Switch to Full (strict) or add the X-Forwarded-Proto snippet to wp-config.php.
I changed the SSL mode but still get the error. Why?
Your browser has probably cached the old 301 redirects. Clear cookies and cache for the site, or test in a private window, before changing anything else.
Will switching to Full (strict) break my site?
Only if your server has no valid certificate. In that case you’ll see a 526 error. Install your host’s free certificate or a Cloudflare Origin CA certificate first.
More step-by-step fixes are in our How-To & Fixes section.
Sources: Cloudflare Docs: ERR_TOO_MANY_REDIRECTS; Cloudflare Docs: Encryption modes; WordPress Developer Resources: HTTPS; cPanel Docs: Domains; WordPress.org: Flexible SSL for CloudFlare. Checked September 2026.


