Lorixen.
EN

ERR_TOO_MANY_REDIRECTS After Turning On Cloudflare or SSL in WordPress

Short answer: A redirect loop appears when two layers disagree about the protocol: usually Cloudflare is set to Flexible SSL, so it talks to your server over plain HTTP, while WordPress or the server insists on HTTPS and sends the visitor back again, forever. Install a valid certificate on the origin server, set Cloudflare's SSL/TLS mode to Full (strict), make sure the WordPress Address and Site Address both start with https://, and keep only one place in charge of forcing HTTPS. Clear cookies and caches before testing, then check one layer at a time.

Draw the map: who is redirecting what

A request can be redirected in four places. Write down what each one is set to before changing anything:

Layer Where the setting lives Typical redirect
Cloudflare SSL/TLS > Overview, Edge Certificates, Page Rules or Redirect Rules "Always Use HTTPS", www to root
Web server .htaccess (Apache), server block (Nginx), hosting panel "Force HTTPS" toggle HTTP to HTTPS
WordPress core Settings > General: WordPress Address and Site Address Sends visitors to the canonical URL
Plugins Really Simple SSL, redirection plugins, SEO plugins, security plugins HTTP to HTTPS, trailing slash, www

The loop is always two of these disagreeing. Either one layer says "go to HTTPS" while another quietly downgrades the request to HTTP, or one says "add www" while another says "remove www".

Why Flexible SSL causes the classic loop

With Cloudflare's Flexible mode, the visitor's browser connects to Cloudflare over HTTPS, but Cloudflare connects to your server over HTTP. Your server sees an HTTP request. If WordPress is configured for https://, or your host has "Force HTTPS" switched on, the server answers "please use HTTPS" with a 301. Cloudflare passes that to the browser, the browser asks again over HTTPS, Cloudflare again fetches over HTTP, and round it goes until the browser gives up with ERR_TOO_MANY_REDIRECTS.

Cloudflare's own troubleshooting page for redirect loops describes this pattern and the related ones.

The fix: Full (strict) with a real origin certificate

The durable fix is to encrypt both legs of the journey:

  1. Get a certificate on the origin. In your hosting panel, issue a free Let's Encrypt or AutoSSL certificate for the domain. Alternatively, create a Cloudflare Origin CA certificate and install it on the server; it is trusted by Cloudflare even though browsers would not trust it directly.
  2. Check the origin answers on HTTPS. Your host's temporary URL or a direct IP test should show the certificate is installed for your domain name.
  3. Switch the mode. In the Cloudflare dashboard go to SSL/TLS > Overview and choose Full (strict). Strict mode checks that the origin certificate is valid and matches the hostname, which also protects the hidden leg of the connection. Details are in Cloudflare's Full (strict) documentation.
  4. Avoid plain Full if you can. "Full" encrypts but does not validate the certificate. It fixes the loop, but strict is the better end state.

If you cannot install a certificate on the origin at all, the fallback is to stop the server and WordPress from redirecting to HTTPS and let Cloudflare do it alone. That works, but traffic between Cloudflare and your server stays unencrypted, so treat it as temporary.

Get the WordPress URLs right

Under Settings > General, both the WordPress Address (URL) and the Site Address (URL) should be identical and start with https://, including or excluding www consistently with your chosen canonical domain.

If you are locked out of wp-admin because of the loop, set the values elsewhere:

  • wp-config.php: add define('WP_HOME', 'https://example.com'); and define('WP_SITEURL', 'https://example.com'); above the line that says to stop editing.
  • Database: in phpMyAdmin, open the wp_options table (the prefix may differ) and edit the siteurl and home rows.
  • WP-CLI: wp option update home 'https://example.com' and the same for siteurl.

Behind a proxy, WordPress sometimes fails to notice that the visitor arrived over HTTPS. With Full or Full (strict) this is rarely an issue, because the request reaching the server really is HTTPS.

Remove duplicate redirect rules

Choose one layer to force HTTPS, and one to handle www versus non-www. A tidy combination for most sites:

  • Cloudflare: Always Use HTTPS on, one redirect rule for www to root (or the reverse).
  • Server: no extra HTTPS rules, or a single rule that agrees with Cloudflare.
  • WordPress: correct https:// URLs.
  • Plugins: disable the HTTPS redirect option in any SSL or security plugin, and check redirection plugins for rules that point back to the address you are redirecting away from.

Look in .htaccess for blocks containing RewriteCond %{HTTPS} off. Two such blocks, one from the host and one pasted in from a tutorial, can conflict. Keep a copy of the file before you edit it.

Clear cookies and caches before you test

Browsers remember 301 redirects and sometimes cookies that drive login redirects. Testing in the same tab after each change can show you the old loop even after the fix. Before each test:

  • Use a fresh private window, or clear cookies and cached files for the domain.
  • In Cloudflare, use Caching > Configuration > Purge Everything.
  • Purge any WordPress caching plugin and the host's server cache.

A test sequence that isolates the culprit

If the loop persists, go layer by layer:

  1. Pause Cloudflare (Overview page, "Pause Cloudflare on Site") or set the DNS record to "DNS only". Wait a few minutes and test. If the loop stops, the cause is in Cloudflare's settings or how they interact with the origin.
  2. Rename the plugins folder temporarily via the file manager (plugins to plugins-off). If the loop stops, rename it back and deactivate plugins one by one.
  3. Rename .htaccess to .htaccess-old. If that fixes it, rebuild the file from Settings > Permalinks (click Save) and add back only the rules you need.
  4. Inspect the chain. Run curl -I https://example.com from a terminal, or use the Network tab in browser DevTools with "Preserve log" on. Each response's Location header tells you exactly where it is sending the visitor, which usually reveals the two layers in conflict.

Turn Cloudflare back on once the origin behaves correctly with Full (strict).

FAQ

Why did the loop only start after I installed an SSL plugin?

The plugin started forcing HTTPS at WordPress level, while Cloudflare in Flexible mode was still sending HTTP to the server. Changing Cloudflare to Full (strict) usually fixes it without removing the plugin.

Will switching to Full (strict) break my site?

Only if the origin has no valid certificate for the domain. Issue one in the hosting panel first, then switch. If the site then shows a 526 error, the certificate is missing or does not match the hostname.

The admin area loops but the front end works. What is different?

Login and admin redirects depend on cookies and FORCE_SSL_ADMIN. Clear cookies, check that the URLs in Settings > General use HTTPS, and remove any older FORCE_SSL_ADMIN lines added for a previous setup.

If you have been round these steps and the loop is still there, describe your setup to us and we will trace the redirect chain with you.

Sources

WhatsAppBook a call