ERR_TOO_MANY_REDIRECTS

DIRECT ANSWER
`ERR_TOO_MANY_REDIRECTS` means the browser is trapped in a redirect loop instead of reaching the requested page. Common causes include conflicting HTTP/HTTPS or www rules, a CDN SSL-mode mismatch, stale cached redirects, or an application that does not recognize HTTPS forwarded by a proxy. Trace the `Location` headers first, then correct the conflicting layer and retest with fresh headers.
Key takeaways
- Trace the complete redirect chain before changing settings; repeated
Locationheaders usually reveal which layers are sending the request back and forth. - If a CDN terminates HTTPS, verify that its connection mode matches the origin. Cloudflare Flexible mode can loop when the origin forces HTTPS.
- Choose one canonical hostname—www or non-www—and remove duplicate or opposing redirects across the CDN, web server, CMS, and plugins.
- After changing redirect settings, purge relevant caches and retest in a private window or with a fresh command-line request.
- If the loop affects only logged-in users, inspect cookies, session settings, and application HTTPS or proxy detection as well as server redirects.
Site Administrator
What this error means & how to recognize it
- The browser displays “This page isn’t working — [domain] redirected you too many times” or the error code
ERR_TOO_MANY_REDIRECTS. - The address bar repeatedly switches between HTTP and HTTPS, or between www and non-www hostnames, before the browser stops loading.
- The entire site may fail, or the problem may be limited to one URL, the admin area, logged-in sessions, or particular devices.
- The issue often begins after enabling HTTPS, adding a CDN or reverse proxy, changing the canonical hostname, or installing a redirect or SSL plugin.
- Clearing cookies may temporarily change the behavior when authentication or session logic is involved, but it does not fix a server-side redirect conflict.
Root causes, ordered by likelihood
- Conflicting HTTP/HTTPS rules — one layer redirects HTTP to HTTPS while another incorrectly redirects HTTPS back to HTTP. This commonly occurs when a proxy or CDN terminates TLS but the origin does not recognize that the original request was secure.
- CDN SSL/TLS mode mismatch — a CDN may use HTTP to connect to an origin that forces HTTPS. The origin redirects to HTTPS, but the CDN repeats the HTTP-to-origin request, creating a loop.
- Competing www and non-www canonical rules — the CDN, web server, CMS, or a plugin may disagree about which hostname is canonical.
- Incorrect proxy or forwarded-protocol handling — the application may not trust the configured proxy or correctly process
X-Forwarded-Protoor an equivalent header, so it repeatedly treats a secure request as HTTP. - Stale redirect caching — a browser, CDN, reverse proxy, or page cache may still serve a redirect from before the configuration was corrected.
- Duplicate application or plugin rules — force-SSL, login, maintenance, or redirect plugins may conflict with server-level rules.
- Cookie or session configuration problems — incorrect
Secure, domain, or path settings can cause authentication redirects for only some users, especially logged-in visitors.
How to fix it
1. Capture the redirect chain first
Use a read-only request from a terminal, replacing the placeholder with the affected hostname:
curl -IL https://[your-hostname]This requests headers and follows redirects. Record every Location: value and HTTP status code. Test the exact failing URL, the HTTP version, and both www and non-www forms where relevant. A browser’s Network panel provides similar evidence.
Look for patterns such as:
- HTTPS → HTTP → HTTPS
- non-www → www → non-www
- one URL repeatedly redirecting to itself
- a redirect to a login or canonical URL that immediately redirects back
Do not begin by clearing caches or changing several settings at once. The chain helps identify which layer needs attention.
2. Fix an HTTP/HTTPS or CDN loop
If a CDN or reverse proxy handles the public HTTPS connection, inspect its SSL/TLS mode and the origin’s certificate and HTTPS configuration. The CDN-to-origin mode must match what the origin supports. With Cloudflare, an origin that correctly supports HTTPS generally requires Full or Full (strict) rather than Flexible when the origin itself forces HTTPS.
Before changing the mode, confirm that you are authorized to modify the CDN and that the origin has a valid certificate for the hostname when strict certificate validation is used. Changing CDN TLS settings can affect live traffic, so follow the approved change process or maintenance-window requirements.
3. Correct proxy HTTPS detection
If the application forces HTTPS while running behind a proxy, configure the application or framework to trust the intended proxy and recognize the forwarded protocol. Depending on the platform, settings may be called trust proxy, trusted proxies, or force-SSL settings.
Only trust forwarded-protocol headers from a known, controlled proxy path. Do not blindly trust client-supplied headers on a directly exposed origin. Check the platform’s documentation for the correct setting, then retest the redirect chain.
4. Resolve www versus non-www disagreement
Choose one canonical hostname and document it. Inspect the CDN, web-server configuration, .htaccess rules where applicable, CMS URL settings, and redirect plugins.
Keep one authoritative hostname redirect—for example, non-www to www or www to non-www—and remove duplicate or opposing rules. Check all HTTP and HTTPS variants after the change. A canonical URL setting that differs from the web server’s target can recreate the loop even when HTTPS is configured correctly.
5. Review application, login, and cookie behavior
If anonymous users can load the page but logged-in users cannot, compare the redirect chain with and without the session cookie using an authorized test account or a private window. Inspect force-SSL, login, membership, and redirect plugins, along with the application’s configured site URL.
Check that session cookies use the correct Secure attribute, domain, and path for the chosen HTTPS hostname. Disable or change one suspected plugin at a time under the change-control process. Do not remove authentication or security controls on a production site without a rollback plan.
6. Purge stale redirects and retest
After correcting the configuration, purge relevant CDN, reverse-proxy, and page-cache entries if you are authorized to do so. Browser redirects can also persist, so retest with curl, a private window, and, if needed, a separate network or device.
A successful test should reach the intended page without a repeating Location sequence. Check the canonical hostname, HTTP-to-HTTPS behavior, login flow, and representative internal URLs rather than testing only the home page.
Prevention & how to verify the fix
- Document the canonical hostname and intended HTTP-to-HTTPS behavior before adding a CDN, reverse proxy, CMS plugin, or server rule.
- Keep each redirect decision authoritative in one layer where possible, and ensure other layers do not issue an opposing rule.
- When placing a site behind a proxy, configure trusted-proxy and forwarded-protocol handling deliberately; do not accept client-supplied forwarding headers indiscriminately.
- Test the full redirect chain after HTTPS, hostname, CDN, CMS, or plugin changes using the exact URLs users access.
- Include anonymous, logged-in, www, non-www, HTTP, and HTTPS tests in deployment checks when those paths are supported.
- Purge or version relevant caches after redirect changes, then verify from a private window or clean client.
When to get outside help
Contact the hosting, CDN, or platform provider when the chain includes a redirect that is not present in your visible configuration, changes only at the provider edge, or continues after origin rules are corrected and caches are purged. Provide the exact failing URL, timestamps, status codes, and Location sequence from a fresh request. Remove cookies, authorization headers, tokens, and other private data before sharing diagnostic output.
Frequently asked questions
Can Cloudflare Flexible SSL cause ERR_TOO_MANY_REDIRECTS?
Yes. If Cloudflare connects to the origin over HTTP while the origin forces every request to HTTPS, the origin can redirect repeatedly. Verify the origin’s HTTPS capability and use a CDN SSL/TLS mode that matches it; for a correctly configured HTTPS origin, Cloudflare’s Full or Full (strict) modes are generally the relevant options.
Should HTTPS redirects be configured in the CDN, web server, or application?
The important requirement is a consistent design with no opposing rules. Choose an authoritative layer for the public HTTP-to-HTTPS redirect and make sure the CDN, web server, CMS, and plugins agree about the result. An application behind a proxy must also correctly recognize the original HTTPS request.
Why does the error affect only logged-in users?
Login and session logic may redirect based on the detected scheme, configured site URL, or cookie scope. Compare the chain for anonymous and authenticated requests, then inspect force-SSL settings, trusted-proxy configuration, and cookie Secure, domain, and path attributes.
Why does clearing cookies sometimes appear to fix the error?
Cookies can preserve a session or authentication state that triggers a redirect path unavailable to anonymous visitors. Clearing them may remove the symptom for that browser, but a server, CDN, or application rule still needs correction if the loop returns for other users.
How can I find which rule is causing the redirect loop?
Capture the complete response-header chain for the exact failing URL with a read-only request such as curl -IL https://[your-hostname]. Compare each Location header and status code with the CDN, server, CMS, and plugin configuration to identify the layer that changes the destination.
Further documentation
For implementation details, consult the documentation for the CDN or reverse proxy in use, the web server handling the origin request, and the CMS or framework’s trusted-proxy and HTTPS settings. Also consult documentation for any redirect, SSL, caching, or authentication plugins involved. Provider documentation is particularly useful for SSL/TLS modes, forwarded-protocol headers, cache purging, and certificate validation.