A redirect loop occurs when a website repeatedly redirects a user back and forth between different URLs, often caused by a conflict between Cloudflare's Flexible SSL setting and the origin server's configuration. This article helps you identify and resolve this issue by adjusting your Cloudflare SSL/TLS settings.
Important: This issue typically occurs when your origin server is not configured to handle requests from Cloudflare correctly, specifically when Cloudflare communicates with your server over HTTP while the browser connects to Cloudflare via HTTPS.
Before you begin
You will need:
A Cloudflare account with the domain added to your account.
Access to the Cloudflare DNS and SSL/TLS dashboard.
Access to your origin server's configuration (if you choose to change the server's behavior).
Adjusting Cloudflare SSL/TLS Settings
To resolve a redirect loop caused by the Flexible SSL setting, you must change the encryption mode to Full or Full (Strict).
Log in to your Cloudflare account.
Select the domain experiencing the redirect loop.
Navigate to SSL/TLS > Overview.
Locate the Overview section and identify the current SSL/TLS encryption mode.
Select Full or Full (Strict).
Click Save (or the equivalent confirmation button).
Warning: Switching to Full or Full (Strict) requires that your origin server has a valid SSL certificate installed. If your server does not have a certificate, your site may become inaccessible until one is installed.
Confirm the result
Once you have updated the setting, verify the fix by performing the following:
Open your browser's "Incognito" or "Private" mode.
Navigate to your website's URL.
The site should load successfully without a "Too many redirects" error.
If the site becomes inaccessible after switching to Full (Strict)
If your site stops loading after switching to Full (Strict), it usually means your origin server does not have a valid, trusted SSL certificate.
Check if your origin server has a certificate installed.
If you do not have a certificate on the origin server but want to keep the Full setting, you may need to ensure the server is not forcing a redirect from HTTP to HTTPS internally.
If you cannot install a certificate on the origin server immediately, you may need to revert to Full (not Strict) or contact your hosting provider to verify the certificate status on the origin.
Limitations
This procedure only addresses redirect loops caused by the Flexible setting. It does not resolve redirect loops caused by incorrect
.htaccessrules, WordPress plugins, or internal application logic.Switching to Full (Strict) requires a valid certificate on the origin server. If your certificate is self-signed or expired, Full (Strict) will result in a connection error.
