Skip to content

How to Check Where an Address Redirects

Last checked 15 November 2026

The address bar can fool you. It shows where you ended up, not how you got there. To see the code and the destination, you need to look at the server's reply before the browser follows it.

The quick look: your browser

Type the old address and watch the bar. If it changes to a different address, some redirect happened. That's all you learn. The bar doesn't say whether the redirect was permanent or temporary, or how many hops it took.

The proper look: curl

curl is a command line tool for fetching web addresses, and its manual is public. Open a terminal and give it your old address.

The -I option fetches the headers only, which means the reply's label lines without the page itself.1

curl -I https://example.com/old-page

The reply starts with a status line. A code beginning with 3 is a redirect, and a Location line holds the address to go to next.2

A status line starting with 3 plus a Location line means the address redirects. You've just read both the code and the target.2

Checking one addressAsk for the headers onlyRead the status codeRead the Location lineRepeat for the next address
Ask for the headers, read the code, follow the Location.

Following the whole path

By default curl stops at the first reply. Adding -L makes it redo the request at the new place. Used with -I, it shows the headers from every page it requests.1

curl -IL https://example.com/old-page

Now you'll see a block for each hop. Count them. One block with a redirect and one final block is a clean move. Several redirect blocks is a chain. The same address showing up twice is a loop.

If a loop is possible, curl won't run forever. The --max-redirs option limits how many redirects it follows.1

What to write down

For each old address, record three things: the code, the Location it returns, and whether that destination answers with a normal reply. Add them to the sheet from the planning page. Then compare against what you meant.

A common surprise is the code. You meant a permanent move and the server says temporary. Google treats the two kinds differently in search results, which is why it matters.3

Checking many addresses

Google's advice is to test the redirects once they're live. Its URL Inspection tool in Search Console suits single addresses, and command line tools or scripts suit large numbers.4

A short script can run the same curl line over your list and save the results. Test a sample from each group of pages at the least.

Other things that can redirect

If the server says the address is fine but the browser still jumps, a page can contain its own redirect. MDN says server redirects run first, and the HTML and JavaScript kinds only act if no earlier one did.2 Look inside the page's source for a refresh tag or a script line that sets the location.

Cited material

  1. curl manual page, curl project
  2. Redirections in HTTP, MDN Web Docs
  3. Redirects and Google Search, Google Search Central
  4. Site move with URL changes, Google Search Central