After setting up Cloudflare, I am encountering the "ERR_TOO_MANY_REDIRECTS" error

What is the name of the domain?

scifinx.com

What is the error number?

ERR_TOO_MANY_REDIRECTS

What is the issue you’re encountering

I had no issues until I set up Cloudflare and added the DNS addresses provided by Cloudflare to my domain address. However, after setting up Cloudflare and adding the DNS addresses you provided to my domain address, I started encountering the “ERR_TOO_MANY_REDIRECTS” issue and have been unable to identify the source of the problem. As a result, I cannot access my website (including the admin panel) at the moment. I contacted the company my VPS is connected to and the company where I registered my domain address, but they said there is no problem on their side and that the issue must be related to the Cloudflare setup. I am seeking your assistance in identifying and resolving the source of my problem. I wish you good work and healthy days.

What steps have you taken to resolve the issue?

There are no redirect rules set up on Cloudflare, and the SSL certificate is set to Full.

Use “Full (strict)” so Cloudflare checks your origin SSL certificate and connections are fully secured.

Wordpress on your origin server is redirecting http://www.scifinx.com/ to 'https://www.scifinx.com/` but there is a redirect on Cloudflare redirecting https://www.scifinx.com/ back to http://www.scifinx.com/, hence the circular redirects.

See…
https://cf.sjr.org.uk/tools/check?30f9eb9232cd48e9a579a2be5629630e#connection-server-https

Check again for Redirect Rules and Page Rules here…
https://dash.cloudflare.com/?to=/:account/:zone/rules/redirect-rules (scroll down and check under Bulk Redirects as well)
https://dash.cloudflare.com/?to=/:account/:zone/rules/rules

4 Likes

First of all thank you very much for your response and interest!

That’s exactly my issue; I can’t understand why Cloudflare is doing such a redirect. All my settings are as attached. There are no redirect rules. In the Page Rules section, I select the option to redirect “scifinx.com/*” to HTTPS, but after clicking save, it gives error code 1004 and doesn’t allow me to set that rule.

You have “Always use HTTPS” set so that shouldn’t be needed.

Who are you using as a host? Can you show a screenshot of your DNS records?

2 Likes

I am using a VPS that I purchased through Namecheap. My DNS settings are as follows. The domain’s DNS is directed to the NS provided by Cloudflare. Additionally, when I check using DNS Checker, I see different results for scifinx.com and www.scifinx.com. See: DNS Checker

Those DNS records have no effect as you are using Cloudflare nameservers. You need to look at the Cloudflare DNS records here…
https://dash.cloudflare.com/?to=/:account/scifinx.com/dns/records

2 Likes

I thought you wanted the DNS on the server, my mistake, sorry. Below are the Cloudflare DNS records.

By the way, after setting up Cloudflare, I had no issues for about 1 day and was able to access the site. When I tried to log into the WordPress admin panel this morning, I noticed this error. I forgot to mention this detail.

It’s ok, I just wanted to see if your host was using Cloudflare - it isn’t. Your mail subdomain should be set to “DNS only” though, not “Proxied”.

Are you sure your SSL/TLS setting is “Full (strict)”? The redirect has changed since I first tested it. https://www.scifinx.com is now redirecting to itself (rather than to http) which indicates the SSL/TLS setting is Flexible.
https://cf.sjr.org.uk/tools/check?497123ba9ea34b83b1c7e7449dea7a45#connection-server-https

3 Likes

SSL was set to Full; I lowered it to Strict after you mentioned it. It’s currently set this way. For mail, it’s set to ‘DNS only’ and not proxied.

So, I can’t determine where the error is coming from; I’m stuck. I haven’t changed any settings. It was working normally after the setup, and then suddenly I started getting this error. It’s very strange because I’m encountering this for the first time. I’m not very professional in these areas, actually.

Strict is an increase in the setting, and the only setting you should use for your site to be secure. Keep it there while we keep looking.

2 Likes

Can you turn off your Page Rules for the moment?

1 Like

I turned off all active settings in the Rules tab atm.

Just bear with me, it’s a bit strange, testing in one place it seems to be working…

curl -I https://www.scifinx.com/
HTTP/2 200
date: Mon, 22 Jul 2024 18:05:17 GMT
content-type: text/html; charset=UTF-8
link: <https://www.scifinx.com/wp-json/>; rel="https://api.w.org/", <https://www.scifinx.com/wp-json/wp/v2/pages/293>; rel="alternate"; title="JSON"; type="application/json", <https://www.scifinx.com/>; rel=shortlink
cf-cache-status: DYNAMIC
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=d4jvouJigWIF4iiuDrKMHOUbSOAPuvhjwxcBsL%2BQtrBNRvsZ44QpBgnAewXsX1%2F0xHhvJl16IlMsugZgZGuHTMakPQOVfsw8eI8uCvRzilQh7OoWL19TwUsVU3PjPZKttVLT%2BPxhUeLOJ4zAB9I%3D"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
server: cloudflare
cf-ray: 8a755ba328d476d5-LHR
alt-svc: h3=":443"; ma=86400

…but in most others it’s not, still redirecting (same server, same underlying cURL)…
https://cf.sjr.org.uk/tools/check?4a91e224a0164cc0a7483ec551b5c7b3#connection-worker-http

I’m a bit confused at the moment, someone else might get there before I do!

2 Likes

Can you purge the Cloudflare cache?

1 Like

Not from what I see.

That sends a HEAD request instead of a GET request, and the origin doesn’t seem to redirect that.

The redirects are all coming from the Origin, not from Cloudflare.

curl -svo /dev/null https://scifinx.com/ --connect-to ::199.188.203.145
...
Location: https://www.scifinx.com/
curl -svo /dev/null https://www.scifinx.com/ --connect-to ::199.188.203.145
...
X-Redirect-By: WordPress
Location: https://www.scifinx.com/
3 Likes

I can currently access the admin panel, but it’s incredibly slow. The general issue persists; I can only access the admin panel. It’s ridiculous, really ridiculous. Even though I haven’t changed any settings, it suddenly started giving a redirection error. :slight_smile:

I’ve purged the cache now.

What could be causing this issue? And what is the solution? Because I haven’t changed any settings, I did a multisite WordPress installation via Softaculous and then set up Cloudflare. Everything was working fine until just a day ago.

By the way, the multisite installation I did opens at /es. You can check it out at https://www.scifinx.com/es/