Definition
A redirect loop is when redirects point back to each other, for example A to B and B to A, so the page can never load.
Redirect loop explained
Browsers detect loops and stop with an error such as “too many redirects”. Search engine crawlers stop too, and the URL can't be indexed. Unlike a slow chain, a loop makes the page completely unreachable.
Loops usually come from conflicting rules in different places:
- A CDN forcing HTTPS while the server forces HTTP, or vice versa.
- A CMS setting for www conflicting with a server rule for non-www.
- A redirect plugin rule clashing with the server configuration.
- Trailing-slash rules that add and remove the slash on alternate requests.
- Language or location redirects that bounce between versions.
Fixing a loop means finding every layer that can issue redirects (CDN, load balancer, web server, CMS and plugins) and making them agree on one canonical protocol, hostname and URL format. Test with a redirect checker that shows each hop, and test again after any hosting or CDN change.
Example
After switching on your CDN's “always use HTTPS” setting, your site shows “too many redirects”. The web server was still sending HTTPS requests back to HTTP. Changing the server rule to trust the CDN's HTTPS connection ends the redirect loop.
Why it matters
A redirect loop takes a page, or a whole site, offline for visitors and search engines until it is fixed.
Related service
301 Redirections
Redirect mapping, chain and loop clean-up so URL changes keep their rankings and links.
301 redirect management servicesPublished by Vidern, founded and led by Malhar Shah. Updated .
Planning a migration or URL change?
Tell us what's changing and we'll reply within 1 business day with how we'd protect your rankings.
Related terms
- Redirect chainA redirect chain is a series of redirects where URL A redirects to B, which redirects to C, and so on, instead of A going straight to the final URL.
- 301 redirectA 301 redirect is a permanent redirect: the server tells browsers and search engines that a URL has moved for good and sends them to the new address.
- CDN (Content Delivery Network)A CDN (content delivery network) is a network of servers in many locations that delivers your site's files from the one nearest each visitor.
- Site migrationA site migration is any major change to a website's platform, domain, URL structure or design that can affect how search engines crawl, index and rank it.