A redirect loop happens when two or more URLs keep sending the browser back to one another until the browser stops the chain. The user sees an error such as too many redirects, and the application becomes difficult to use. It usually points to flawed routing logic or conflicting redirect rules.
What causes a redirect loop to happen?
A redirect loop is usually a routing defect, not a browser defect. It appears when two paths keep redirecting to each other because a rule matches too broadly, a canonical URL is mis-set, or application logic cannot tell which destination is final.
In practice, loops often arise after login flows, HTTP to HTTPS upgrades, trailing-slash normalization, host consolidation, or reverse-proxy rewrites. A small mismatch in one rule can turn an intended single hop into an endless chain.
When the loop is driven by server-side logic, the browser is only reporting the symptom, not the cause. The real issue is that the application cannot reach a stable end state for the request.
How do redirect loops affect availability and user experience?
The immediate effect is loss of usability. The browser eventually stops following redirects and shows an error such as too many redirects, which blocks access to the page and can make an entire site or flow appear broken.
Loops can also interrupt authentication journeys, payment pages, account recovery, or any workflow that depends on a stable URL transition. If the loop sits in a shared middleware layer, multiple pages may fail at once.
Because the user sees a generic browser error, the underlying defect can be difficult to distinguish from an outage, a cached redirect, or a misconfigured edge rule. That makes fast diagnosis important when the loop affects production traffic.
What configuration patterns commonly create redirect loops?
One common pattern is conflicting redirect rules across layers, such as an application redirecting to one host while a proxy or CDN redirects back to another. Another is inconsistent canonicalisation, where one component forces HTTPS, adds a trailing slash, or rewrites a subdomain while another component undoes that change.
Loops also occur when conditional logic depends on state that never becomes true, such as a login callback, cookie check, locale selector, or account status flag that is evaluated differently on each request. In those cases, the redirect is technically valid in isolation but wrong as part of the full request path.
For adjacent identity and access journeys, the same pattern can break sign-in or session establishment even when the redirect itself is not the security control. A stable sequence matters because the application must be able to complete authentication before it can enforce access decisions.
How should practitioners prevent and troubleshoot redirect loops?
Start by tracing the full redirect chain and identifying which layer owns each hop. Compare application routes, proxy rules, load balancer behaviour, and edge configuration so that only one component is responsible for each canonical redirect.
Then verify the final destination for the most common request variants, including http and https, www and non-www, slash and non-slash, and authenticated versus unauthenticated requests. The goal is to make the destination deterministic, not merely plausible.
When a loop is intermittent, inspect caching, session state, and conditional routing, because the failure may appear only for specific browsers, locales, or request headers. A redirect loop is often easiest to fix when the full path is observed from the first request to the point where the browser stops.
Risk and Threat Considerations
Redirect loops are usually accidental, but they can still create real security and operational exposure. A broken redirect chain can block authentication, hide availability problems, and push users toward cached or alternate paths that were not intended for the flow.
Failure mechanism: Conflicting routing or rewrite rules keep sending requests back and forth, so the request never reaches a stable terminal page or policy decision.
Impact: The site or workflow becomes unavailable, login and recovery flows can fail, and troubleshooting becomes harder because the browser error masks the underlying control failure.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST CSF 2.0 and CIS Controls v8 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST CSF 2.0 | PR.AC-1 — Identity Management, Authentication and Access Control | Redirect loops can block authentication and access flows that CSF protects. |
| PR.PT-4 — Communications and Control Networks | Redirect loops often arise in routing, proxy, and network control paths. | |
| Recommendation — Stabilize login and access redirects so users can complete authenticated access paths. Align proxy and routing controls so redirect handling is consistent across layers. | ||
| CIS Controls v8 | 12.4 — Network Ports, Protocols, and Services Management | Redirect behaviour is governed by exposed services, proxies, and web routing paths. |
| Recommendation — Review service and proxy rules to eliminate conflicting redirect logic. | ||
| OWASP Non-Human Identity Top 10 | NHI-03 — Secret and Credential Exposure | If a redirect loop breaks auth flows, it can impede secure handling of login-related credentials. |
| Recommendation — Verify authentication redirects do not disrupt secure credential exchange. | ||
Related resources from NHI Mgmt Group
Deepen Your Knowledge
Reviewed and updated by the NHIMG editorial team on September 17, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org