When trying to open a website or webpage, you may come across the ‘Too Many Redirect’ error. Its a Redirect loop error caused by the Cloudflare service and there are two reasons behind this error. These are:
Now let’s look at how to fix this error.
If Cloud SSL is Incompatible
If you have Flexible SSL mode enabled, Cloudflare will send unencrypted requests to origin web server over HTTP. When the origin web server is so configured to redirect HTTP requests to HTTPS for the Flexible SSL mode, then it results in Redirect loop.
The same error can occur if you have selected the Full or Full (strict) mode. There are two ways to fix this error:
The first way is to remove the redirects, either HTTP to HTTPS or HTTPS to HTTP. Here’s an example to demonstrate this:
The second way is to update the Cloudflare SSL option. If its set to Flexible, change it to Full or Full (Strict) and check if the error is resolved. To change the mode, navigate into the ‘SSL/TLS app Overview tab’.
If Page Rule is Misconfigured
If the Page Rule is not configured properly, you will face redirect loops. In some cases, there are two or more Page Rules with Forwarding URL settings. If they conflict each other, there’s a high chance you’ll get the ‘Too Many Redirect’ error.
To check if there are conflicting rules, navigate into Rules >> Page Rules. Remove some of the rules that are of less importance.
To prevent such things from happening, you can make use of the Cloudflare WordPress plugin at origin web server. Along with that, enable the Automatic HTTPS rewrites option in the plugin.
Other plugins you can install are SSL insecure content fixer or Really Simple SSL.
So that’s how you fix the redirect loops and the Cloudflare Too Many Redirect error.
- Cloud SSL settings are not compatible with the configuration of the origin’s web server
- The Page Rule is misconfigured
Code:
The page isn’t redirecting properly
ERR_TOO_MANY_REDIRECTS
If Cloud SSL is Incompatible
If you have Flexible SSL mode enabled, Cloudflare will send unencrypted requests to origin web server over HTTP. When the origin web server is so configured to redirect HTTP requests to HTTPS for the Flexible SSL mode, then it results in Redirect loop.
The same error can occur if you have selected the Full or Full (strict) mode. There are two ways to fix this error:
The first way is to remove the redirects, either HTTP to HTTPS or HTTPS to HTTP. Here’s an example to demonstrate this:
Code:
Apache – RewriteRules
nginx – Rewrite directives and 301 return directives
If Page Rule is Misconfigured
If the Page Rule is not configured properly, you will face redirect loops. In some cases, there are two or more Page Rules with Forwarding URL settings. If they conflict each other, there’s a high chance you’ll get the ‘Too Many Redirect’ error.
To check if there are conflicting rules, navigate into Rules >> Page Rules. Remove some of the rules that are of less importance.
To prevent such things from happening, you can make use of the Cloudflare WordPress plugin at origin web server. Along with that, enable the Automatic HTTPS rewrites option in the plugin.
Other plugins you can install are SSL insecure content fixer or Really Simple SSL.
So that’s how you fix the redirect loops and the Cloudflare Too Many Redirect error.