Skip to main content
miji.be

Redirect Loop

An error condition where two or more URLs redirect to each other in a circular pattern, preventing the browser from reaching any destination.

May 1, 2026 / About 1 min read

Redirect

A redirect loop occurs when URL A redirects to URL B, and URL B redirects back to URL A, creating an infinite cycle that prevents the browser from ever reaching a final destination. Browsers detect this condition after a set number of redirects (typically 20) and display an error message such as "This page isn't working" or "Too many redirects."

Redirect loops are a common configuration error that can arise from misconfigured server rules, conflicting redirect directives, or circular DNS settings. A frequent cause is conflicting HTTP-to-HTTPS and HTTPS-to-HTTP rules, where the server alternates between protocols indefinitely. Another common scenario involves www and non-www redirects that contradict each other.

In URL shortening, redirect loops can occur if a short URL's destination is set to another short URL that eventually points back to the original. Well-designed shortening services detect and prevent circular references during link creation by checking whether the destination URL resolves to the same service.

Diagnosing redirect loops requires tracing the full redirect path using tools like curl with the -L flag, browser developer tools, or online redirect checkers. The fix involves identifying the conflicting rules and correcting the redirect logic to break the cycle.

Was this article helpful?

Related Terms

Redirect Chain

A sequence of multiple redirects between the initial URL and the final destination, where each redirect points to another redirect.

301 Redirect

A permanent HTTP redirect that tells browsers and search engines the resource has moved permanently to a new URL.

HTTP Status Code

A three-digit number returned by a web server indicating the result of a client's request.

Client-Side Redirect

A redirect executed by the browser using HTML meta tags or JavaScript, after the initial page has been partially loaded.

Redirect Caching

A mechanism in which browsers and CDNs store redirect responses for a certain period and skip querying the origin server on later visits.

Open Redirect

A web application vulnerability that redirects users to any externally specified URL without validation. Exploited in phishing attacks.

Related Articles

301 vs 302 Redirects - Choosing the Right Type for Short URLs

Understand the differences between 301 and 302 HTTP redirects. Learn how each type affects SEO, analytics, and performance for short URLs.

How URL Shorteners Work - The Technical Side of Redirects

Discover the technical mechanics behind URL shortening: hash generation, database lookups, HTTP redirects, and more. Includes HTTP response examples and base-62 encoding calculations.

Self-Hosting a URL Shortener: Full Link Control

Explore the benefits and challenges of running your own URL shortening service. Covers open-source tools, serverless architecture, and cost-performance tips.

FAQ

What are the main causes of redirect loops?
Common causes include circular redirect configurations like A → B → A, CMS permalink setting inconsistencies, and conflicting settings between CDN and origin server.
How do you resolve a redirect loop?
Check the server's redirect configuration and eliminate circular references. Inspect .htaccess, nginx.conf, and CDN settings in order, verifying the redirect destination at each step.

Put the terms to work

Shorten a URL for Free