ERR_TOO_MANY_REDIRECTS
After you add a new domain to Cloudflare, your visitors’ browsers might display ERR_TOO_MANY_REDIRECTS
or The page isn’t redirecting properly
errors.
This error occurs when visitors get stuck in a redirect loop.
flowchart LR accTitle: Redirect loops illustration A[Request for <code>http://</code><code>example.com</code>] --> B[Redirect to <code>https://</code><code>example.com</code>] B --> C[Redirect to <code>http://</code><code>example.com</code>] C --> B subgraph Redirect Loop B C end
This error is commonly caused by:
- A misconfiguration of your SSL/TLS Encryption mode.
- Various settings in SSL/TLS > Edge Certificates.
- A misconfigured redirect rule.
Your domain’s SSL/TLS Encryption mode controls how Cloudflare connects to your origin server and how SSL certificates presented by your origin will be validated.
This setting can cause redirect loops when the value you set in Cloudflare conflicts with the settings at your origin web server.
If your domain’s encryption mode is set to Flexible, Cloudflare sends unencrypted requests to your origin server over HTTP.
Redirect loops will occur if your origin server automatically redirects all HTTP requests to HTTPS.
flowchart TD accTitle: Redirect loops illustration for Flexible mode A[Request for <code>https://</code><code>example.com</code>] --> B[Encryption mode redirects to <code>http://</code><code>example.com</code>] B --> C[Origin server redirects to <code>https://</code><code>example.com</code>] C --> B subgraph Cloudflare B end subgraph Origin server C end
To solve this issue, either remove HTTPS redirects from your origin server or update your SSL/TLS Encryption Mode to be Full or higher (requires an SSL certificate configured at your origin server).
If your domain’s encryption mode is set to Full or Full (strict), Cloudflare sends encrypted requests to your origin server over HTTPS.
Redirect loops will occur if your origin server automatically redirects all HTTPS requests to HTTP.
flowchart TD accTitle: Redirect loops illustration for Full or Full (strict) mode A[Request for <code>http://</code><code>example.com</code>] --> B[Encryption mode redirects to <code>https://</code><code>example.com</code>] B --> C[Origin server redirects to <code>http://</code><code>example.com</code>] C --> B subgraph Cloudflare B end subgraph Origin server C end
To solve this issue, remove HTTP redirects from your origin server.
If you have Always Use HTTPS enabled for your domain, Cloudflare redirects all http
requests to https
for all subdomains and hosts in your application.
Redirect loops will occur if your origin server automatically redirects all HTTPS requests to HTTP.
flowchart TD accTitle: Redirect loops illustration for Always Use HTTPS A[Request for <code>http://</code><code>example.com</code>] --> B[Always Use HTTPS redirects to <code>https://</code><code>example.com</code>] B --> C[Origin server redirects to <code>http://</code><code>example.com</code>] C --> B subgraph Cloudflare B end subgraph Origin server C end
To solve this issue, remove HTTPS redirects from your origin server or disable Always Use HTTPS.
If you have HTTP Strict Transport Security (HSTS) enabled for your domain, Cloudflare directs compliant web browsers to transform http
links to https
links.
Redirect loops will occur if your origin server automatically redirects all HTTPS requests to HTTP or if you have your domain’s encryption mode set to Off.
flowchart TD accTitle: Redirect loops illustration for HTTP Strict Transport Security A[Request for <code>https://</code><code>example.com</code>] --> B[Encryption mode redirects to <code>http://</code><code>example.com</code>] B --> C[HSTS redirects to <code>https://</code><code>example.com</code>] C --> B C --> D[Origin server redirects to <code>http://</code><code>example.com</code>] D --> C subgraph Cloudflare B C end subgraph Origin server D end
To solve this issue, remove HTTPS redirects from your origin server and make sure your domain’s encryption mode is Flexible or higher.
Alternatively, disable HTTP Strict Transport Security (HSTS).
Redirect loops can also occur if you have conflicting URL redirects.
flowchart TD accTitle: Redirect loops illustration for redirect rules A[Request for <code>https://</code><code>a.example.com</code>] --> B[Redirect to <code>http://</code><code>b.example.com</code>] B --> C[Redirect to <code>https://</code><code>a.example.com</code>] C --> B subgraph Cloudflare B C end
To solve this issue, review your various redirect rules and Page Rules to make sure no rules are not in conflict with each other.