in using CDN and Security Services from CloudflareSometimes users may encounter "ERR_TOO_MANY_REDIRECTS" error. This error usually occurs when there is an infinite redirection loop between the browser and the server, resulting in the page not loading properly. If you are facing this issue, this article will guide you through a series of steps on how to resolve ERR_TOO_MANY_REDIRECTS error in Cloudflare.
![图片[1]-如何修复 Cloudflare 中的 ERR_TOO_MANY_REDIRECTS 错误:解决方案和配置技巧](https://www.361sale.com/wp-content/uploads/2025/02/20250212112828683-image.png)
1. Understanding ERR_TOO_MANY_REDIRECTS Errors
![图片[2]-如何修复 Cloudflare 中的 ERR_TOO_MANY_REDIRECTS 错误:解决方案和配置技巧](https://www.361sale.com/wp-content/uploads/2025/02/20250212114147918-image.png)
The "ERR_TOO_MANY_REDIRECTS" error occurs when the browser keeps trying to access a web page, but because of a misconfiguration, the web page keeps redirecting until it exceeds the browser's limit. Usually this is related to Cloudflare's SSL/TLS ConfigurationThe following are some examples of how to configure your site's caching: redirection settings on the source server, or the site's caching configuration.Related.
2. Check and properly configure SSL/TLS settings
![图片[3]-如何修复 Cloudflare 中的 ERR_TOO_MANY_REDIRECTS 错误:解决方案和配置技巧](https://www.361sale.com/wp-content/uploads/2025/02/20250212114235926-image.png)
Cloudflare providesSeveral different SSL/TLS modes, each mode has different security requirements and behaviors. If not set up properly, it can easily lead to redirection loops, especially in the HTTP and HTTPS Conversion between.
- Flexible SSL: Cloudflare uses HTTPS encryption with the browser, but still uses HTTP with the source server. this mode works for servers without SSL certificates. However, it often leads to redirection issues, as the source server may have been configured to force HTTPS redirection.
- Full SSL: Cloudflare uses HTTPS encryption with both the browser and the origin server. This requires that the source server has a properly installed SSL certificate. This mode is the most common choice, especially if the source server supports HTTPS.
- Strict SSL: Cloudflare uses HTTPS encryption with both the browser and the source server, and the source server's SSL certificate must be valid and trusted. Choosing Strict SSL maximizes security, but can also result in ERR_TOO_MANY_REDIRECTS errors if the source server SSL configuration is incorrect.
Solution:
If your source server is configured with an SSL certificate, it is recommended to use the Full SSL maybe Strict SSL mode. Avoid using the Flexible SSL, because it may conflict with the source server's redirection rules.
3. Enable "Automatic HTTPS Rewrite" feature
![图片[4]-如何修复 Cloudflare 中的 ERR_TOO_MANY_REDIRECTS 错误:解决方案和配置技巧](https://www.361sale.com/wp-content/uploads/2025/02/20250212114318773-image.png)
Cloudflare provides"Automatic HTTPS Rewrite" feature that forces all HTTP requests to automatically redirect to HTTPS. this helps to resolve redirection loops caused by mismatches between HTTP and HTTPS.
Operational Steps:
- Log in to the Cloudflare console.
- Select your site and click on "SSL/TLS" settings.
- Under the Edge Certificates tab, enable Automatic HTTPS Rewrite.
When this feature is enabled, Cloudflare ensures that on all visits to HTTP pages, the browser automatically jumps to the HTTPS version, thus avoiding redirection errors.
4. Clearing the Cloudflare Cache
![图片[5]-如何修复 Cloudflare 中的 ERR_TOO_MANY_REDIRECTS 错误:解决方案和配置技巧](https://www.361sale.com/wp-content/uploads/2025/02/20250212114449723-image.png)
Cloudflare caches the content of your web pages, including the redirection rules on the page. The cache may hold incorrect redirection information, causing users to always be directed to the wrong page. Clearing the cache is a common and effective way to resolve ERR_TOO_MANY_REDIRECTS errors.
Operational Steps:
- Log in to the Cloudflare console.
- Select your site and go to the "Cache" tab.
- Click the "Clear Cache" button and select "Clear All Cache".
After clearing the cache, the browser reloads the page to avoid incorrect redirection information stored in the cache.
5. Check the redirection settings of the source server
If your source server is configured with the wrong redirection rules, it can also cause a conflict between Cloudflare and the source server, which can trigger a redirection loop. For example, the source server may be set to force redirect HTTP requests to HTTPS, but if Cloudflare's settings conflict with that, an ERR_TOO_MANY_REDIRECTS error will occur.
Operational Steps:
- Check the source server's .htaccess file(for Apache servers) or Nginx configuration files to ensure that there are no excessive redirection rules.
- Ensure that the source server's HTTPS-forced redirection does not conflict with Cloudflare's configuration.
6. Turning off Cloudflare proxy mode
![图片[6]-如何修复 Cloudflare 中的 ERR_TOO_MANY_REDIRECTS 错误:解决方案和配置技巧](https://www.361sale.com/wp-content/uploads/2025/02/20250212114636725-image.png)
If you suspect that Cloudflare's configuration is causing the problem, try temporarily disabling the Cloudflare's Agent ModelBypassing Cloudflare's servicesIf you have a problem with Cloudflare, you can access the source server directly. In this way, you can determine if the problem is with Cloudflare.
Operational Steps:
- Log in to the Cloudflare console.
- Select your site and go to the "DNS" tab.
- Click on the cloud icon next to your A record and CNAME record to toggle it to gray (i.e. disable proxy mode).
- Wait a few minutes and try visiting the site again to see if the problem is resolved.
7. summarize
The "ERR_TOO_MANY_REDIRECTS" error is usually caused by theIncorrect SSL/TLS configuration, caching issues, or redirection settings on the origin serverCaused by. By checking and correctly configuring the Cloudflare's SSL/TLS Mode, "Enable"Automatic HTTPS rewriting" feature, clearing the cache and checking the source server's redirection rules can effectively resolve this issue. If you are still experiencing difficulties, consider temporarilyDisable Cloudflare Or contact the support team for further assistance.
Link to this article:https://www.361sale.com/en/33120The article is copyrighted and must be reproduced with attribution.
No comments