TechCorner HQ · Technical Troubleshooting Guide

Cloudflare ERR_TOO_MANY_REDIRECTS: Causes and How to Fix It

By TechCorner HQ Editorial Desk Last reviewed Review standards

Quick Resolution: Fixing Cloudflare ERR_TOO_MANY_REDIRECTS

The ERR_TOO_MANY_REDIRECTS error (or "The page isn't redirecting properly") occurs when a browser gets trapped in an infinite HTTP redirect loop. When traffic routes through Cloudflare, this loop frequently happens when Cloudflare's SSL/TLS encryption mode is set to Flexible while the origin web server is configured to automatically redirect all incoming HTTP traffic to HTTPS.

Conceptual network routing loop diagram representing infinite browser redirects and server configuration errors.

To fix this directly in the dashboard:

  1. Log in to the Cloudflare dashboard and select your domain.
  2. Go to SSL/TLS > Overview.
  3. Change the encryption mode from Flexible to Full or Full (strict).
  4. Clear your browser cache or test in an incognito window to verify access.

If enabling Strict mode triggers certificate errors such as ERR_SSL_VERSION_OR_CIPHER_MISMATCH or Error 526, verify that your origin server has an active, valid SSL certificate installed before enforcing strict verification.

How SSL/TLS Modes Create Redirect Loops

Cloudflare manages two distinct connections: the connection between visitors and Cloudflare edge servers, and the connection between Cloudflare and your origin server. The origin connection depends entirely on your configured SSL/TLS encryption mode:

  • Flexible: Visitor traffic connects to Cloudflare over HTTPS, but Cloudflare forwards requests to your origin server using unencrypted HTTP over port 80. An SSL certificate is not required on the origin.
  • Full: Visitor traffic connects over HTTPS, and Cloudflare connects to your origin server using HTTPS over port 443. The origin certificate can be self-signed, issued by Cloudflare Origin CA, or issued by a public CA.
  • Full (strict): Visitor traffic connects over HTTPS, and Cloudflare requires a valid, unexpired SSL certificate on the origin server issued by a trusted public CA or Cloudflare Origin CA.

When Cloudflare is set to Flexible mode, Cloudflare sends unencrypted HTTP requests to the origin. If your origin web server or application framework forces HTTPS, the origin rejects the HTTP request and sends a 301 Moved Permanently or 302 Found redirect back to Cloudflare pointing to the https:// URL. Cloudflare relays that response to the browser, the browser requests the HTTPS URL again, and Cloudflare once more connects to the origin over HTTP. This triggers an endless loop until the browser terminates the request with ERR_TOO_MANY_REDIRECTS.

Other Common Causes of Redirect Loops

Beyond SSL mode conflicts, redirect loops can arise from conflicting configurations across edge and application layers:

  • Conflicting Edge Rules: Enabling Always Use HTTPS or HSTS on the Edge Certificates page while your origin server redirects HTTPS requests back to HTTP creates a continuous loop between the edge and origin.
  • Misconfigured Redirect Rules: URL redirect rules configured under Rules > Redirect Rules or legacy Page Rules that rewrite HTTPS destinations back to HTTP.
  • Application URL Scheme Mismatch: Content management systems configured with an http:// site address while the edge or server forces HTTPS.

Diagnostic Steps: Finding the Redirect Source

Before modifying production configurations, identify whether the redirect is triggered by the origin server or Cloudflare edge rules using command-line diagnostic tools.

1. Query the Origin Directly via cURL

Test the origin server directly, bypassing Cloudflare proxy servers, using curl with the --connect-to option:

curl -svo /dev/null http://example.com --connect-to ::192.0.2.1

Replace example.com with your domain name and 192.0.2.1 with your actual origin IP address.

  • If the origin returns an HTTP 301 or 302 status containing a Location: https://example.com/ header, your origin forces HTTPS. You must update Cloudflare SSL/TLS to Full or Full (strict), or remove the redirect on the origin.
  • If the origin returns an HTTP 200 OK status, the origin serves plain HTTP without enforcing HTTPS redirects.

2. Inspect Proxy Response Headers

Inspect the full redirect chain through the proxy:

curl -IL https://example.com

This outputs the exact sequence of HTTP response codes and Location headers, confirming whether the edge or origin is issuing repetitive redirect instructions.

Step-by-Step Solutions

Option 1: Switch Cloudflare SSL/TLS to Full or Full (strict)

If an SSL certificate is installed on your origin server, switching your encryption mode resolves the loop immediately.

  1. Log in to the Cloudflare dashboard and select your zone.
  2. Navigate to SSL/TLS > Overview.
  3. Select Full or Full (strict).

Warning: Selecting Full (strict) requires an active, unexpired certificate issued by a trusted public CA or Cloudflare Origin CA on port 443. If your origin lacks a trusted certificate or uses an untrusted self-signed certificate, Full (strict) will trigger Error 526. Use Full mode for self-signed certificates, or install a free Cloudflare Origin CA certificate before selecting Strict.

Option 2: Correct Application Site URLs (WordPress)

If your application settings enforce an unencrypted scheme while edge encryption is active, update the site configuration constants. Always take a complete backup of your database and application files before making direct configuration edits. If you experience database connectivity problems during maintenance, refer to our diagnostic guide on WordPress Error Establishing a Database Connection.

To define domain schemes in wp-config.php:

  1. Access your web server using SSH, SFTP, or your hosting control panel.
  2. Open the wp-config.php file in your website root directory.
  3. Add the following definitions above the line that says /* That's all, stop editing! */:

define('WP_HOME', 'https://example.com');
define('WP_SITEURL', 'https://example.com');

Save your changes and clear any active server-side or plugin caching.

Option 3: Review Edge Certificate and Redirect Rules

Inspect Cloudflare features that enforce HTTPS or rewrite URLs:

  1. Go to SSL/TLS > Edge Certificates.
  2. Check the Always Use HTTPS setting. If enabled while your origin server redirects HTTPS connections back to HTTP, an edge loop occurs.
  3. Navigate to Rules > Redirect Rules and confirm that existing rules do not forward traffic to http:// destinations.

Verification

After adjusting your SSL settings or edge rules, confirm normal operation:

  • Open browser Developer Tools (F12) and check the Network tab. Request your domain and verify that the page returns an HTTP 200 OK status without circular redirects.
  • Clear your local browser cache or test in a private browsing window to prevent cached 301 redirects from triggering false positives.
  • If your site handles background webhooks that report delivery failures after updating edge routing, consult our guide on WooCommerce Webhooks Automatically Disabled After Delivery Failures to trace webhook header issues.

Sources & References