Glossary
Redirect chain
A sequence of two or more HTTP redirects between a requested URL and the page that finally loads.
A redirect chain is a sequence of two or more redirects between the URL a client requests and the page that finally loads. Instead of one hop from an old address to a new one, the request bounces through several intermediate URLs, each answering with a 3xx status and a Location header that points to the next. Chains usually build up by accident as sites change domains, move to HTTPS, restructure their paths and add tracking or shortening layers on top.
A single redirect is normal and useful: it keeps old links working after a page moves. A chain adds a network round trip for every extra hop, makes crawlers and preview services do more work, and creates more places for something to break. When the last hop leads nowhere, or back to an earlier URL, the chain turns into a broken link or a redirect loop. Redirect chains are one of the quieter causes of link rot, and one of the first things any software that fetches URLs has to handle well.
How redirects work
When a server wants a client to fetch a different URL, it returns a status code in the 3xx range with a Location header. The client then requests the new URL, which may itself redirect. Each status code carries a slightly different meaning, and the differences matter for caching, search engines and requests that carry a body.
Status | Meaning | Typical use |
|---|---|---|
301 Moved Permanently | The resource has a new permanent address | Domain moves, permanent URL changes |
302 Found | Temporary redirect; clients may change the method to GET | Short-term moves, login flows |
303 See Other | Fetch the result at another URL with GET | After a form submission |
307 Temporary Redirect | Temporary, and the method and body must be kept | Temporary moves of API endpoints |
308 Permanent Redirect | Permanent, and the method and body must be kept | Permanent moves of API endpoints |
Not every redirect uses HTTP status codes. A page can contain a meta refresh tag that sends the browser elsewhere after a delay, or JavaScript that sets window.location once the page loads. These client-side redirects only work for clients that parse the HTML or run scripts, so a plain HTTP fetcher stops at the first page while a browser or a headless browser carries on. A chain can mix both kinds, which is why the same URL can resolve differently in a simple fetcher and in a real browser.
How redirect chains form
Most chains are layers of old decisions. A common example on a single site: a link points to http://example.com/blog/post, which redirects to https://example.com/blog/post when the site adopts HTTPS, then to https://www.example.com/blog/post when it standardises on the www host, then to https://www.example.com/articles/post after a content migration, and finally to the same path with a trailing slash. Four hops, each added by a different person for a sensible reason, none of them aware of the others.
Links shared on social media and in email add their own layers. A shortened URL redirects to a tracking domain, which records the click and redirects to the destination, which may then apply the site’s own redirects. Marketing tools, affiliate networks and link-wrapping security gateways in corporate email all insert hops of this kind. By the time a reader lands on the page, the original request may have passed through five or six servers run by different companies.
Chains also form after acquisitions and rebrands, when a company points its old domain at its new one, and the new site later reorganises. And they form inside applications, where login walls, consent pages, regional routing and A/B tests can all add a redirect before the content appears.
Why redirect chains matter
Each hop costs time. A redirect to a new host can need a fresh DNS lookup, a new TCP connection and a TLS handshake before the next response arrives, so a three-hop chain on a slow mobile connection can add a noticeable delay before the first byte of the real page. For people, that is a slower page. For software making thousands of requests, it multiplies the cost of every fetch.
Search engines treat long chains as a crawling problem. Google’s documentation says Googlebot follows a limited number of redirect hops (up to ten) before giving up, and recommends redirecting directly to the final URL. Every extra hop also gives a crawler one more opportunity to hit an error, a timeout or a rate limit. Pointing internal links, sitemap.xml entries and canonical URL tags straight at the final address avoids most of this.
Chains also complicate identity. Two URLs that look different may lead to the same page, and the same starting URL may lead to different pages on different days. Any system that stores links, from a bookmark manager to a knowledge base, needs to decide whether it keys records by the URL it was given or the URL it ended up at. Getting this wrong causes duplicate records that deduplication then has to clean up.
Redirect loops
A loop is a chain that returns to a URL it has already visited, for example when one rule sends www to the bare domain and another sends the bare domain back to www. Browsers stop after a fixed number of hops and show an error such as ERR_TOO_MANY_REDIRECTS. Automated clients need their own limit, otherwise a loop can tie up a worker indefinitely or, with retries, multiply into a burst of requests against the same site.
Redirects in crawling, link previews and agents
Software that reads the web follows redirects constantly. A web crawler or web scraping job needs to know where each URL leads so it can record the final address, avoid fetching the same page twice and respect the robots.txt of the destination host as well as the starting one. A link preview service needs to follow the chain to the real page before it can read Open Graph tags, meta tags or schema.org structured data. In link unfurling, a chain that passes through a tracking domain is one reason a preview sometimes shows the wrong title or a generic card.
Agents add a further concern: they often fetch URLs that came from users, documents or other websites. A redirect can send a request from a harmless-looking public URL to an internal address, which is a common route for server-side request forgery. Safe fetchers check every hop, not only the first URL, refuse redirects to private or loopback addresses, and limit the number of hops. The same caution applies to open redirects on trusted domains, which attackers use to make a malicious destination look legitimate.
How to handle redirect chains
On your own site, the fix is to collapse chains. Audit redirects with a crawler, update every rule so it points directly at the final URL, update internal links and sitemaps to use final URLs, and keep permanent redirects (301 or 308) in place for old addresses that others link to. Choose one canonical host and protocol and redirect everything else to it in a single hop.
When fetching other people’s URLs, treat redirects as data worth keeping. Record the starting URL, every hop with its status code, the final URL and the declared canonical URL, along with the time of the fetch. Set a hop limit (ten is a common choice), detect loops by tracking visited URLs, and apply retry logic with exponential backoff only to transient failures such as timeouts or HTTP 429 responses. Strip known tracking parameters when comparing final URLs, so the same page reached through different campaigns counts once. This record is part of a link’s URL metadata, and it is what lets you tell a moved page from a dead one when you re-check a collection later.
A worked example
A sales team pastes 2,000 company URLs into an enrichment tool. A redirect-aware fetch finds that 1,300 load directly, 520 pass through one redirect (mostly HTTP to HTTPS), 140 pass through two or more, 25 end in errors, and 15 loop. Keying records by final URL merges 60 pairs of entries that turned out to be the same company under old and new domains. The 140 longer chains include several acquired companies whose old domains now point to the parent, which is useful information in its own right. (The figures are illustrative.)
Where Exabase fits
The free Exabase Link Preview API (GET /v2/link) follows redirects and returns the final URL along with the canonical URL, so your application gets the resolved address without writing its own redirect handling. It renders pages with JavaScript before parsing, returns the title, description, site name, image and favicon, and caches results for up to 24 hours. The link preview guide and the LinkPreview model describe the response. It does not document the individual hops in a chain, so if you need the full hop list, record it with your own fetcher.
For full page content, Exabase Extract accepts a URL, processes documents and media as files and plain web pages as bookmarks, and returns structured JSON with the page text as chunks; the submitting jobs guide covers URL submission. Saved as bookmarks in Resources, pages are fetched, captured and indexed for Deep Search. In each case Exabase does the fetching and parsing, and your application decides how to key, deduplicate and re-check its links. The Link Preview API roundup and Exabase vs Microlink compare redirect handling and other features across preview services, and the web scraping API roundup covers crawling at larger scale.
FAQs
How many redirects is too many?
One hop is normal; two or more is a chain worth fixing on your own site. Browsers allow around 20 hops before showing an error, and Google’s documentation says Googlebot follows up to 10, but every extra hop adds delay and risk.
What is the difference between a redirect chain and a redirect loop?
A chain is a series of redirects that eventually reaches a page. A loop returns to a URL it has already visited and never reaches a page, so clients stop after a hop limit and report an error.
Do redirect chains hurt SEO?
They can. Long chains slow crawling, risk crawlers giving up before the final page, and waste crawl capacity on intermediate URLs. Redirecting old URLs directly to the final address and linking internally to final URLs avoids the problem.
Should I use a 301 or a 308 redirect?
Both are permanent. A 308 requires clients to keep the original method and body, which matters for API endpoints that receive POST requests. For ordinary page moves, 301 and 308 behave the same in practice.
How do I find the final URL of a link programmatically?
Request the URL with redirects enabled, set a hop limit and record the final URL, or call a service that does this for you. The Exabase Link Preview API returns the final URL and the canonical URL for any public page.
Are JavaScript redirects followed by crawlers?
Only by crawlers that render pages. A plain HTTP client stops at the page that contains the script, while a headless browser follows it. Server-side 301 or 308 redirects are more reliable for any URL that others link to. See JavaScript rendering for how rendering crawlers work.
Related pages: link rot, canonical URL, link preview, URL metadata, web crawler, link unfurling, favicon, Link Preview API, best link preview API, Exabase vs Microlink