Website Discussion

Too many redirects error on website (cloudfare)

  • cloudfare
  • website

3 comments

Dura Johnson
1 month ago

Thank you so much @caleb adeleye

Caleb Adeleye
1 month ago

I have been in this situation before and I will tell you how I solved the problem, but before i go into the solution I need to first explain what this error means, it simply means that your website is experiencing an infinite loop which is caused by the requests that your website sends to Cloudflare.

So the next question to ask is what exactly is this request?
If you noticed, when you pause Cloudfare the error goes away but you need the SSL from Cloudfare. What is happening is your website script is sending HTTPS to Cloudfare instead of HTTP. Cloudafre needs HTTP to be sent to it so that is can return HTTPS.
So this is what is causing that redirect loop.

How To Solve This:
You need to check your website script for where HTTPS is being sent to out, my best guess is going to be your htaccess file. its in that file that the HTTPS is being sent, if you are unable to locate the file, it could have been hidden, depending on the web host you are using, allow hidden files and you will see the file, check for something like his line and comment it out
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
save it and reload your website it should work.

Caleb Adeleye
1 month ago

I have been in this situation before and I will tell you how I solved the problem, but before i go into the solution I need to first explain what this error means, it simply means that your website is experiencing an infinite loop which is caused by the requests that your website sends to Cloudflare.

So the next question to ask is what exactly is this request?
If you noticed, when you pause Cloudfare the error goes away but you need the SSL from Cloudfare. What is happening is your website script is sending HTTPS to Cloudfare instead of HTTP. Cloudafre needs HTTP to be sent to it so that is can return HTTPS.
So this is what is causing that redirect loop.

How To Solve This:
You need to check your website script for where HTTPS is being sent to out, my best guess is going to be your htaccess file. it's in that file that the HTTPS is being sent, if you are unable to locate the file, it could have been hidden, depending on the web host you are using, allow hidden files and you will see the file, check for something like his line and comment it out
RewriteRule https:
save it and reload your website it should work.