---
title: "Capture every hop of a redirect chain | Proofline"
description: "\"The link takes me to the wrong page\" is a report about a redirect chain, and the landing URL hides the hops."
url: https://proofline.sh/learn/redirect-chain-evidence/
---

[Learning center](/learn/)

# Capture every hop of a redirect chain

"The link takes me to the wrong page" is a report about a redirect chain, and the landing URL hides the hops. The maintainer needs every hop: each URL, status, Location header and Set-Cookie. Three tools show the chain, and one of the obvious ones undercounts it.

Network outages The Proofline team November 22, 2026 3 min read

## Three ways to see the chain, compared

We built a fixture with a three-hop chain: `localhost/r1` sent 302 to `/r2`, which sent 301 to `127.0.0.1/r3`, a different origin, which sent 302 to `/final`.

| Tool | What it showed |
| --- | --- |
| DevTools Network panel with **Preserve log** on | Each request as its own row, with status and the `Location` response header |
| Playwright, following `request.redirectedFrom()` from the final response back | All four URLs in order |
| `performance.getEntriesByType('navigation')[0].redirectCount` on the final page | `0`, because one redirect crossed origins |

A second chain with two same-origin redirects reported `redirectCount` as `2`. Navigation Timing hides redirect details from the final page when a redirect crossed origins, so a `0` there does not mean the chain was direct. [MDN: `PerformanceNavigationTiming.redirectCount`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigationTiming/redirectCount)

## Capture it in DevTools

1.  Open the Network panel and turn on **Preserve log**, so the panel keeps requests across the navigation.
2.  Turn on **Disable cache**, or note that you left it off. A browser can serve a cached 301 without asking the server, which changes what the chain shows.
3.  Click the link or load the starting URL.
4.  For each redirect row, copy the status, the request URL, the `Location` header and any `Set-Cookie` headers.

[Chrome DevTools: Network features reference](https://developer.chrome.com/docs/devtools/network/reference)

## Capture it outside the browser

`curl` shows each hop's headers when it follows redirects:

```
curl -sS -o /dev/null -D - -L 'https://example.test/promo?ref=mail'
```

`-D -` prints each response's headers, and `-L` follows `Location`. curl sends no browser cookies unless you give it a cookie jar with `-b` and `-c`, so a chain that depends on cookies will differ. That difference is evidence. [Replay the request outside the page](/learn/replay-browser-request-curl/) covers copying the browser's headers.

## Capture it in a script

```
const response = await page.goto('https://example.test/promo?ref=mail');
const chain = [];
for (let req = response.request(); req; req = req.redirectedFrom()) chain.unshift(req.url());
console.log(chain);
```

Add `(await req.response())?.status()` to each entry if the statuses matter. [Playwright: `request.redirectedFrom()`](https://playwright.dev/docs/api/class-request#request-redirected-from)

## What to look for in each hop

-   **Dropped query parameters.** A hop that redirects `/promo?ref=mail` to `/promo/` without the query loses attribution or state.
-   **Scheme and host changes.** `http` to `https`, `www` to the apex domain and back. Two layers doing opposite rewrites make a [redirect loop](/learn/too-many-redirects-loop/).
-   **Cookies set on a hop.** A cookie set on a redirect response is stored before the next request, if the browser accepts it. Check its `Domain`, `Path`, `Secure` and `SameSite`.
-   **Permanent redirects.** A 301 or 308 can be cached by the browser, so the reporter's browser may follow an old redirect the server no longer sends.

## Worked example: a campaign link that lost its code

This example is fictional. Marketing reports that a newsletter link lands on the pricing page without the discount banner. The link is `https://example.test/go/winter`.

The Network panel with **Preserve log** shows three hops: `/go/winter` 302 to `/pricing?coupon=WINTER`, then 301 to `https://www.example.test/pricing`, then 200. The second hop, a host canonicalization rule at the CDN, rebuilt the URL without its query string. The report gave each hop's status and `Location`, so the maintainer went straight to the CDN rule rather than the application's link handler.

## Questions

### Why does the reporter see a redirect the server no longer sends?

The browser may have cached a 301 or 308. In our fixture, a repeated navigation through a 301 loop made no requests to the server at all. Test in a fresh profile, and clear the site's cached data in the reporter's browser to confirm.

### Can JavaScript or meta refresh redirects appear in the chain?

They appear as separate navigations, not as HTTP redirects. With **Preserve log** on you see each document request; `redirectedFrom()` and `redirectCount` do not include them.

### Do I need the response bodies?

Rarely. The status and headers decide where the browser goes. A body matters only for a page that redirects with JavaScript.

Return to [reproducing what someone else saw](/learn/replay-browser-bug-report/) for the other layers a replay needs.

## One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. [Eligibility and fair-use terms](/free-code-review/).

[Start free with GitHub](https://proofline.sh/orgs/plan?offer=free_month)

## Related reading

-   ### [ERR\_TOO\_MANY\_REDIRECTS: a cookie that never sticks, or two layers that disagree](/learn/too-many-redirects-loop/)
    
    Permission errors The Proofline team November 22, 2026 4 min read
    
-   ### [Browser or server? Replay the failing request outside the page](/learn/replay-browser-request-curl/)
    
    Network outages The Proofline team November 20, 2026 5 min read
