Skip to content

Latest commit

 

History

History
173 lines (130 loc) · 6.39 KB

too-many-redirects.md

File metadata and controls

173 lines (130 loc) · 6.39 KB
title pcx_content_type weight meta
ERR_TOO_MANY_REDIRECTS
troubleshooting
2
description
Learn how to troubleshoot ERR_TOO_MANY_REDIRECTS when using Cloudflare SSL/TLS.

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://example.com</code>] --> B[Redirect to <code>https://example.com</code>]
B --> C[Redirect to <code>http://example.com</code>]
C --> B
subgraph Redirect Loop
B
C
end
Loading

This error is commonly caused by:

{{

}}

For assistance determining if your origin web server is responding with redirects, contact your hosting provider or site administrator.

{{

}}


Encryption mode misconfigurations

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.

Flexible encryption mode

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://example.com</code>] --> B[Encryption mode redirects to <code>http://example.com</code>]
B --> C[Origin server redirects to <code>https://example.com</code>]
C --> B
subgraph Cloudflare
B
end
subgraph Origin server
C
end
Loading

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).

Full or Full (strict) encryption mode

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://example.com</code>] --> B[Encryption mode redirects to <code>https://example.com</code>]
B --> C[Origin server redirects to <code>http://example.com</code>]
C --> B
subgraph Cloudflare
B
end
subgraph Origin server
C
end
Loading

To solve this issue, remove HTTP redirects from your origin server.


Edge certificate settings

Always use HTTPS

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://example.com</code>] --> B[Always Use HTTPS redirects to <code>https://example.com</code>]
B --> C[Origin server redirects to <code>http://example.com</code>]
C --> B
subgraph Cloudflare
B
end
subgraph Origin server
C
end
Loading

To solve this issue, remove HTTPS redirects from your origin server or disable Always Use HTTPS.

HSTS

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://example.com</code>] --> B[Encryption mode redirects to <code>http://example.com</code>]
B --> C[HSTS redirects to <code>https://example.com</code>]
C --> B
C --> D[Origin server redirects to <code>http://example.com</code>]
D --> C
subgraph Cloudflare
B
C
end
subgraph Origin server
D
end
Loading

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 rules

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://a.example.com</code>] --> B[Redirect to <code>http://b.example.com</code>]
B --> C[Redirect to <code>https://a.example.com</code>]
C --> B
subgraph Cloudflare
B
C
end
Loading

To solve this issue, review your various redirect rules and Page Rules (deprecated) to make sure no rules are not in conflict with each other.

{{

}}

To reduce the potential for redirect loops and mixed content errors, Cloudflare recommends WordPress users to install the Cloudflare WordPress plugin at their origin web server and enable the Automatic HTTPS rewrites option within the plugin. Alternatively, Cloudflare recommends the SSL insecure content fixer or Really Simple SSL plugin.

{{

}}