Fixing a redirect loop
Please use the “Print” function at the bottom of the page to create a PDF.
This article explains what a redirect loop is, why errors such as "ERR_TOO_MANY_REDIRECTS" occur, and how to fix it quickly and effectively.
What is a redirect loop?
When you visit a website, the server can redirect your browser to another address, e.g. from http:// to https:// or from example.com to www.example.com. However, if two or more redirects refer to each other, an endless loop is created: your browser is repeatedly sent back and forth between the same addresses without ever reaching the actual page.
As a rule, the browser cancels the process after a certain number of redirects (approx. 20) and displays an error message. The wording varies depending on the browser:
- Google Chrome: "This page does not work. [URL] has redirected you too many times." (Error code: ERR_TOO_MANY_REDIRECTS)
- Firefox: "The page is not redirected correctly.
- Microsoft Edge: "This page is not working at the moment." (Error code: ERR_TOO_MANY_REDIRECTS)
- Safari: "Safari cannot open the page."
Regardless of the wording, the cause is always the same: your browser is stuck in a redirect loop.
Possible causes
- Outdated or faulty cookies: Old cookies can cause an endless loop between the login page and the target page, especially on pages with a login.
- Incorrect web server configuration: An incorrectly configured redirect on the server can trigger the redirect loop.
- Incorrect migration from HTTP to HTTPS: If an SSL certificate has been set up but the redirects are not correctly configured, a loop can occur.
- Conflicts between www and non-www: If the redirects between the www variant (e.g. www.example.com) and the non-www variant (e.g. example.com) of your domain contradict each other, a redirect loop may occur.
- Incorrect CDN or proxy settings: If you are using a CDN such as Cloudflare, an incorrectly configured SSL/TLS encryption mode (e.g. "Flexible" instead of "Full") can cause the CDN to send unencrypted requests to your server. If your server then redirects these to HTTPS, an endless loop is created.
- HSTS configuration (HTTP Strict Transport Security): If HSTS is enabled but the SSL/TLS mode is not set correctly, the browser can get caught in a loop between HTTP and HTTPS versions.
- Incorrect WordPress settings: Different values for the WordPress address (URL) and the page address (URL) can lead to a redirect loop.
- Conflicts between plugins: Multiple plugins that control redirects can interfere with each other.
Step-by-step troubleshooting guide
Work through the following solutions in sequence. After each step, check whether the redirection loop has been resolved.
Step 1: Delete cookies
Delete the cookies for the affected website in your browser. Outdated or faulty cookies are one of the most common causes of redirect loops.
Tip: Open the website in an incognito or private window of your browser. No cookies or extensions are loaded in this mode. If the page works perfectly there, the problem is with the browser data. Alternatively, you can test the site in another browser.
Step 2: Empty the cache
Empty the cache of your browser. If you operate the affected website yourself, also empty the following caches:
- WordPress cache: If you use WordPress, clear the cache via your caching plugin (e.g. WP Super Cache or W3 Total Cache).
- CDN cache:
- IONOS CDN: If you use the IONOS CDN, you can clear the cache directly in your IONOS account under the CDN settings.
- External CDN / proxy: If you use an external proxy service or a CDN (e.g. Cloudflare), clear the cache in the dashboard of the respective provider.
Step 3: Analyse redirects
If the problem persists, analyse the redirect chain. To do this, use a browser add-on such as Redirect Path (for Chrome) or an online tool. This will help you find out which redirects are causing the loop.
Step 4: Check SSL configuration and HTTP/HTTPS forwarding
A common source of errors is the migration from HTTP to HTTPS. Check the following:
- Make sure that a valid SSL certificate is installed for your domain.
- Check that the forwarding from HTTP to HTTPS is set up correctly and that there are no conflicting rules.
- Check that the forwarding between the www and non-www variants of your domain is clearly pointing in one direction and is not causing a loop.
- Carry out an SSL check to identify possible configuration errors.
Step 5: Check the settings of external CDNs and proxies
Note
For users of the IONOS CDN powered by Cloudflare: If you use the CDN included in your IONOS contract, these forwarding and SSL settings are automatically optimised for you in the background. The following steps only apply if you have a CDN such as Cloudflare directly and independently of IONOS.
If you use an external CDN or a reverse proxy, check the SSL/TLS settings there:
- Make sure that the SSL/TLS encryption mode in your CDN dashboard is set to Full or Full (Strict), not Flexible. In "Flexible" mode, the CDN sends unencrypted HTTP requests to your server. If your server redirects these to HTTPS, an endless loop is created.
- Check whether HSTS (HTTP Strict Transport Security) is activated. If so, make sure that your SSL certificate is configured correctly, as HSTS forces the browser to use HTTPS exclusively.
- Disable HTTPS redirection in your CDN provider's dashboard as a test to see if the CDN is causing the loop.
Step 6: Check WordPress settings
If you are using WordPress, check the URL configuration:
- Open the WordPress dashboard.
- Navigate to Settings > General.
- Compare the fields WordPress address (URL) and Website address (URL).
- Make sure that both values are identical and use the same protocol (both https:// or both http://).
Step 7: Test WordPress plugins individually
If you are using WordPress: First deactivate all WordPress plugins. If the redirect loop no longer occurs, reactivate the plugins one after the other. This will help you identify the plugin causing the loop. Uninstall the affected plugin or replace it with an alternative.
Step 8: Check redirects in the .htaccess file (for advanced users)
If all previous steps have not helped, the cause often lies in a hidden redirect rule on your web space; More precisely, in the .htaccess file.
You can use a simple trick to safely test whether this file is causing the problem without having to understand any code:
- Log into your IONOS account and open Webspace Explorer (alternatively, you can connect via FTP).
- Navigate to the root directory of your affected website.
- Search for the .htaccess file. (Note: You may need to show hidden files in the settings of your FTP application).
- Rename the file as a test, for example, to .htaccess_alt.
- Clear your browser cache and visit your website again.
The result:
- The loop is gone: You now know for sure that an incorrect entry (e.g. an incorrect RewriteRule or Redirect instruction) in the .htaccess is causing the infinite loop. You can now edit the file and remove incorrect lines.
- The loop is still there: The .htaccess is not the source of the error. Simply rename the file back to its original name (.htaccess).
Check result
Once you have rectified the error, test your website thoroughly:
- Visit the website in different browsers.
- Test both the HTTP and HTTPS variants (e.g. http://example.com and https://example.com).
- Test both the www and the non-www versions (e.g. www.example.com and example.com).
In all cases, the website should load without an error message and redirect correctly to the desired target URL.