Skip to content

How to check that a redirect works

Reviewed on 14 November 2026

How can I tell if my redirect is really working?

Ask for the old address and look at what comes back. A browser hides the redirect, because it just loads the new page. So you need a way to see the reply before the jump.

Google tells site owners to test their redirects. It names its URL Inspection Tool for individual addresses, and command line tools or scripts for large numbers of them.1

Checking a redirect from the outsideAsk for the old addressRead the status code and LocationFollow it to the final pageCompare with what you meant
Look at the first reply, then at where the browser ends up.

What should I look for in the reply?

Two things: the status code and the Location line.

MDN says redirect responses have status codes that start with 3, along with a Location header holding the address to go to.2 The standard says a server should send that Location header with a 302.3 MDN describes browsers as loading the address in Location immediately.2

So if you see a status starting with 3 and a Location with the right new address, the redirect is doing its job. If you see an error or the same page, it isn't. The status number also tells you the type. A 301 gives the page a new permanent address, and a 302 means it has been moved temporarily.34 301 and 302 redirects goes through the difference.

How do I see it with curl?

curl is a command line tool for fetching web addresses. Its manual says the -I option, also written --head, fetches the headers only.5

Type curl -I https://example.com/old-page, using your own old address. You'll get the status line and the headers, without the page itself. Read the first line for the status code and find the Location: line for the destination.

To follow the jump, add -L. The manual says this option makes curl redo the request to the new place when the server reports a move.5 Used together with --head, it shows headers from all requested pages.5 That gives you one block per step, which is the quickest way to spot a chain. Why is a long one a problem? This page explains.

If you want a count, curl's --write-out option has a num_redirects value, which is the number of redirects that were followed in the request.5

Why does my browser still show the old result?

Redirects can be remembered. The HTTP standard says a 301 response is heuristically cacheable, which means a cache is allowed to store it.3 So a browser may have kept an earlier answer. It's one reason to check with more than one method before you decide something's wrong.

What should I check after it works?

  • The status type is the one you intended, permanent or temporary.
  • The Location address is the exact page you meant, not the home page.
  • There's one jump, not a string of them.
  • The new address loads and doesn't send visitors back to the old one.
  • Any links you control point at the new address directly.

If a redirect fails any of these, fix the rule and test again. For the rules themselves, see the setup page.

Cited material

  1. Site move with URL changes, Google Search Central
  2. Redirections in HTTP, MDN Web Docs (Mozilla)
  3. RFC 9110: HTTP Semantics, IETF (RFC Editor)
  4. 302 Found, MDN Web Docs (Mozilla)
  5. curl command line manual, curl project