Redirect loop
A redirect loop happens when a browser is sent through a series of web redirects that eventually sends it back to an address it has already requested. The browser keeps receiving instructions to go elsewhere but never reaches a page that returns the content. It stops following redirects and reports an error instead of loading the site.
What can cause a redirect loop?
A loop can happen when two rules point to each other. For example, one rule sends http://example.com to https://example.com, while another rule sends the HTTPS address back to HTTP. A loop can also involve www.example.com and example.com, or occur when a website and a proxy, a server handling requests on its behalf, each believe the other should apply HTTPS.
Each redirect may be valid on its own, but together the rules form a cycle. The browser follows the first response, makes a new request, receives another redirect, and eventually repeats an earlier address. The issue is usually in the combined redirect configuration across the web server, website platform, or proxy.
How is a redirect loop different from a slow site?
A slow site takes time to return a response. In a redirect loop, the browser receives responses but is continually told to make another request. The page content is never reached because the redirect destinations repeat.
For example, if example.com redirects to www.example.com and www.example.com redirects back to example.com, a visitor may see a “too many redirects” message. The domain can still resolve in DNS and the server can still respond; the redirect rules prevent the browser from settling on a final page.
Related terms
- Redirect — the HTTP response that creates each step
- Permanent and temporary redirects — common status code choices
- URL — each redirect identifies a destination address