Redirect Checker

Paste a URL and see every redirect it goes through before a page finally loads: the status code of each hop (301, 302, 307, 308 or an HTML meta refresh), where it points, and how long it took. The check runs from our edge, not from your browser, because a browser follows redirects silently and never exposes the intermediate responses. Use it to find chains, loops and redirects that end on a 404.

Enter a URL to trace its redirect chain

How to read the chain

Each row is one request. A 3xx row with a Location is a hop; the last row is the page that answered with content or an error. One hop is normal, for example http to https. Two or more means the rules are chained and could be collapsed into a single redirect straight to the final URL, which saves a round trip for every visitor and keeps the full ranking signal in one jump.

What the check cannot see

Redirects that depend on cookies, login state, device or country will show their default path, because the request is sent from Cloudflare's network with a generic user agent and no cookies. JavaScript redirects (window.location in a script) are not followed either, only HTTP headers and meta refresh tags.

How to use the Redirect Checker (Trace Redirect Chain) tool

  1. Paste the URL into the input. http:// is added if you leave the scheme out, which is a good way to test the http to https hop.
  2. Click Check Redirects. The tool fetches the URL from our edge without following redirects, reads the status and Location header, and repeats until it reaches a page that returns content, finds a loop, or hits ten hops.
  3. Read the chain top to bottom. Each row shows the hop number, status code, the URL requested, where it pointed and how long it took. A yellow Meta refresh tag means the redirect came from an HTML tag, not an HTTP header.
  4. Check the summary: the final URL, the final status and the number of hops. More than one hop is worth fixing, and a loop or a chain that ends in 4xx or 5xx is broken.
  5. Click Copy JSON to keep the full result, or Dummy Data to see a worked example.

How to trace a redirect chain in code

curl

# -I = HEAD, -L = follow, -s = quiet. Prints every hop's status line and Location.
curl -sIL http://github.com | grep -iE "^(HTTP|location)"

# HTTP/1.1 301 Moved Permanently
# location: https://github.com/
# HTTP/2 200

Add -A "Mozilla/5.0" if a site answers curl differently from a browser, and --max-redirs 10 to stop a loop.

JavaScript (Node.js)

async function traceRedirects(url, max = 10) {
    const hops = [];
    for (let i = 0; i < max; i++) {
        const res = await fetch(url, { redirect: "manual" });
        const location = res.headers.get("location");
        hops.push({ url, status: res.status, location });
        if (res.status < 300 || res.status >= 400 || !location) break;
        url = new URL(location, url).href; // Location may be relative
    }
    return hops;
}

console.log(await traceRedirects("http://github.com"));

redirect: "manual" works in Node.js and on servers. In a browser it returns an opaque response with no status or headers, which is why this tool runs on the edge.

Python (requests)

import requests

r = requests.get("http://github.com", allow_redirects=True, timeout=10)
for hop in r.history:
    print(hop.status_code, hop.url, "->", hop.headers.get("Location"))
print(r.status_code, r.url)

# 301 http://github.com/ -> https://github.com/
# 200 https://github.com/

Common errors and how to fix them

ERR_TOO_MANY_REDIRECTS in the browser
A loop: the destination redirects back to the source. Common causes are a Cloudflare SSL mode set to Flexible while the origin forces HTTPS, or a www rule and a non-www rule that both apply. The checker shows exactly which hop closes the loop.
The chain has three or more hops
Each hop is a full round trip, and Google follows at most ten before giving up. Point the first redirect straight at the final URL instead of chaining http to https, then to www, then to the trailing slash.
The redirect ends on a 404 or 410
The old URL redirects to a page that no longer exists, so visitors and crawlers land on an error. Update the redirect target, or remove the rule and return 410 directly if the content is gone for good.
A 302 is used for a permanent move
Search engines may keep indexing the old URL and split signals between the two. Change the rule to 301 or 308 once you are sure the move will not be reverted.
The tool shows a different destination than my browser
The site redirects by country, language, cookie or device. The check runs with no cookies and a generic user agent from Cloudflare's network, so it sees the default route. Test the specific case with curl and the matching headers.

Specifications and references

This tool follows the specifications below. Read them when you need the exact normative wording, for example to settle an edge case between two implementations.

Frequently Asked Questions

What does a redirect checker show?

Every hop between the URL you enter and the page that finally returns content. For each response you get the status code (301, 302, 307, 308 or a meta refresh), the Location header it points to, the response time and the server header. The chain ends at the first non-redirect response or after ten hops.

Why does my browser show one redirect but the tool shows three?

Browsers follow redirects silently and only show the final address. Typical chains are http to https, then non-www to www, then a trailing slash fix. Each is a separate round trip that slows the page and leaks a little ranking signal, so collapse them into one redirect where you can.

Does it detect redirect loops?

Yes. If a hop points back to a URL already in the chain, the tool stops and flags the loop. A browser would show ERR_TOO_MANY_REDIRECTS for the same URL.

Why is the result different from what I see in my browser?

Some sites redirect based on country, language, device or cookies. The check runs from Cloudflare's network with a generic user agent and no cookies, so a site that sends logged-in users or mobile visitors elsewhere will show its default path here.

Which redirect type should I use for a moved page?

Use 301 for a permanent move, so search engines transfer the ranking and browsers cache it, and 302 for a temporary one. Use 308 and 307 when the request method must be preserved, for example on API endpoints that receive POST. The redirect rule generator writes the server config for all four.

Related

Fix a chain by writing the rule with the redirect rule generator, look up what each code means in the HTTP status code list, or confirm the final host is up with the website down checker.

More URL Tools

Browse all url tools

Copied to clipboard!