How to Fix “Too Many Redirects” in WordPress After Enabling Cloudflare Proxy

I had a client site that was experiencing a bot attack, so naturally, I turned to Cloudflare to mitigate it. Fortunately, it was already on Cloudflare, so all I had to do was enable the Cloudflare proxy in the DNS so it could start intercepting traffic.

But, as soon as I did this, I got a “Too Many Redirects” error when I tried to log into the site. I did what you’re supposed to do, namely, clear caches, but as soon as I did that, the home page gave that error too! I had made a bad situation worse. Strangely, other pages of the site still worked!

After a lot of Googling and semi-panic, I turned to Chat GPT, which gave the solution! Here’s what it said:

Sometimes HTTPS is enabled in WordPress, but the server (or CDN like Cloudflare) is redirecting back and forth between HTTP and HTTPS.

How to fix:

  • If you’re using Cloudflare, set SSL mode to “Full”, not “Flexible”.

The Cloudflare SSL Setting

I checked and my SSL mode was indeed set to “Flexible”!

To check your SSL setting in Cloudflare, go to SSL/TLS -> Overview, then look in the “SSL/TLS encryption” section to find your “Current encryption mode”. If yours is set to “Flexible”, click “Configure”.

Cloudflare SSL/TLS encryption mode
Cloudflare SSL/TLS encryption mode

That will take you to the page below where you can click “Full”, then “Save”.

Cloudflare Full SSL Setting
Cloudflare Full SSL Setting

Once I did that, my site instantly started working! Did this work for you? Please leave a comment below! – Brian

Shares

Discover more from Web Developer Tips and Tricks

Subscribe to get the latest posts sent to your email.

Please Leave a Question or Comment

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments