What is Too Many Redirects Error
The "Too Many Redirects" error occurs when a browser repeatedly attempts to load your website but is caught in a redirection loop, unable to determine the correct destination. After 16 attempts, the browser displays this error, indicating that it cannot proceed further.
Why This Error Happens
This error typically occurs when there is a misconfiguration in your website's redirection settings, leading to conflicting or continuous redirects between URLs. For example, the browser may be redirected between "www" and non-"www" versions of the site without resolution.
Scenarios That Cause the Error and Soultions
1. HTTPS Settings
Issues with HTTPS configuration can result in redirection loops. Consider the following scenarios when setting up HTTPS on VergeCloud:
- Your web server only responds to HTTP requests: Disable the Secure connection of HTTPS with Origin Server setting. VergeCloud will then communicate with your server over HTTP (port 80).
- Your web server only responds to HTTPS requests: Enable the Secure connection of HTTPS with Origin Server setting, so VergeCloud communicates with your server over HTTPS (port 443).
Your web server responds to both HTTP and HTTPS requests: Set the Secure connection of HTTPS with Origin Server to Automatic Mode. This ensures:
- If a user sends a request over HTTP, VergeCloud forwards the request to your server in HTTP.
- If a user sends a request over HTTPS, VergeCloud forwards the request to your server in HTTPS.
2. Transfer Domain to www Setting
When the Transfer domain to www setting is enabled in your CDN configuration, and your web server is configured to serve the website without "www," this mismatch can result in redirections between "www" and non-"www" versions of the site, creating a loop.
How to Prevent the Error
- Review your HTTPS settings in the VergeCloud dashboard and ensure they align with your web server’s protocol settings.
- Verify the "Transfer domain to www" setting and ensure it matches your web server’s configuration to avoid conflicting redirections.
- Test your website after making changes to confirm that no redirection loops occur.
Considerations
- Always test HTTPS configuration changes to avoid unintended redirection loops.
- When using the "Transfer domain to www" setting, ensure consistency between VergeCloud’s configuration and your web server’s response.
- If enabling HTTPS for the first time, verify your origin server settings and confirm compatibility with VergeCloud’s CDN.