Getting a "ERR_TOO_MANY_REDIRECTS" error when using cloudflare

Hey everyone,

I recently followed this guide on how to use Cloudflare for SSL.

I went through the entire process (twice even), and I’m still getting this hour even about 13 hours later - CleanShot 2021-03-25 at 14.35.59

I can confirm my nameservers are set correctly on my domain, and I’ve added the correct DNS settings in Cloudflare.

CleanShot 2021-03-25 at 14.37.00

I’ve set the proper SSL mode in cloudflare -

CleanShot 2021-03-25 at 14.38.43

The site is working perfectly on my staging site - https://plus15.000webhostapp.com/, but nothing is loading on the primary domain - https://calgaryplus15.com/

Any ideas here? I’ve gone through the set up process twice, and I’m getting this error every time.

Your issue was related to your .htaccess and improper rewrite code. If you’re looking to rewrite your site to always point to HTTPS from HTTP, do one of the following:

  1. Turn on “Automatic HTTPS Rewrites” in Cloudflare (I believe it’s under SSL).

  2. Add the following lines to your .htaccess:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Just solved it, it looks like this switch on cloudflare needed to be turned on.

CleanShot 2021-03-26 at 09.33.11

Thanks for the response! It looks like HTTP rewrites was already on, so that shouldnt’ be the issue. I just uploaded that .htacess file in hopes that would work, but I’m still getting the same error.

CleanShot 2021-03-26 at 08.31.50

Looks like you’ve fixed the issue, so sorry for the wait in response. If the rewrite code doesn’t work for you, you should definitely just use Cloudflare’s features.

This topic was automatically closed after 22 hours. New replies are no longer allowed.