DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
curl

Redirect Tester: How to Trace URL Redirect Chains, Status Codes, and Loops

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A redirect tester follows a URL through every HTTP response, recording each status code and Location target until it reaches a final response or stops because of a loop, an error, or a hop limit. The useful result is not merely the final page: it is the complete path, such as http://example.com → https://example.com → https://www.example.com/new, with the status at every step.

This guide explains how to read a trace, reproduce one with command-line tools and code, diagnose SEO and application problems, and account for differences between an automated request and a real browser session.

What a redirect tester actually does

HTTP redirects are responses that tell a client to take further action, usually by requesting the URI in the Location header. A redirect tester sends an initial request, records the response, resolves the next target, requests it, and repeats the process. The report should expose the source URL, status code, destination, and final response.

A trace is therefore different from checking whether a URL eventually opens. A browser can hide several intermediate responses, while a chain report makes configuration errors visible.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What to record for every hop

  • The exact URL requested, including scheme, host, path, query string, and fragment handling.
  • The HTTP status, such as 301, 302, 303, 307, or 308.
  • The complete Location value returned by the server and the resolved absolute target.
  • The request method and, when relevant, whether a request body was retained.
  • The final status, content type, and any error or hop-limit message.

How to read redirect status codes

Redirect codes carry different meanings and can change how clients handle methods and request bodies. The definitions below follow RFC 9110.

Status Meaning Method and use notes
301 Moved Permanently The resource has moved permanently. Historically, some clients changed POST to GET when following it. Do not assume identical behavior across clients.
302 Found A temporary move. Like 301, historical client behavior may change POST to GET.
303 See Other Directs the client to another resource. For retrieval, the follow-up can be GET or HEAD.
307 Temporary Redirect A temporary move. The client must preserve the request method when following it.
308 Permanent Redirect A permanent move. The client must preserve the request method.

For a normal page visit, a GET trace is usually enough. For a form submission, upload, webhook, or API endpoint, test the method and body that the real client uses. A 301 or 302 that appears harmless for a page can break an API client if it changes POST into GET.

Trace a chain from the command line

Use cURL to show every response

To inspect headers without downloading the page body, run:

curl -sS -D - -o /dev/null -L --max-redirs 20 https://example.com/old-page

-D - prints response headers, -o /dev/null discards bodies, and -L follows redirects. The output contains a header block for each hop. Look for the status line and Location: in each block.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a compact, one-line-per-hop view, use cURL’s write-out fields:

curl -sS -L --max-redirs 20 -o /dev/null 
  -w 'final=%{url_effective} code=%{http_code} redirects=%{num_redirects} time=%{time_total}sn' 
  https://example.com/old-page

This summary reports the final URL and count but not every intermediate destination. Use the header trace when you need the complete chain.

Rank #2
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option

Test a single response without following it

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

-I sends HEAD. Some servers handle HEAD differently from GET, so confirm with a GET-style request when results matter:

curl -sS -D - -o /dev/null https://example.com/old-page

Test method preservation for an API or form

curl -sS -D - -o /dev/null -X POST 
  -H 'Content-Type: application/json' 
  --data '{"example":true}' 
  -L --max-redirs 10 https://api.example.com/submit

Use a safe test endpoint and data. Do not replay a production payment, account-creation, or destructive request merely to inspect redirects.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Build a redirect trace in Python

Python’s Requests library exposes the redirect history. This example prints each response and the final result:

import requests

url = "https://example.com/old-page"
response = requests.get(url, allow_redirects=True, timeout=30)

for hop, item in enumerate(response.history, start=1):
    print(f"{hop}: {item.request.method} {item.url}")
    print(f"   {item.status_code} Location: {item.headers.get('Location')}")

print(f"final: {response.request.method} {response.url}")
print(f"status: {response.status_code}")

Each item in response.history is a prior response. The final response is in response. For a POST, pass allow_redirects=True deliberately and inspect each resulting request method; library behavior should not be inferred from a GET test.

To stop before following the next hop, request with allow_redirects=False, read response.headers.get("Location"), resolve relative targets, and apply your own loop and hop-limit checks.

Trace redirects in Node.js

Modern Node.js fetch follows redirects by default. Set redirect: 'manual' to inspect one response at a time:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
const start = 'https://example.com/old-page';
let current = start;
const seen = new Set();
const maxHops = 20;

for (let hop = 1; hop <= maxHops; hop++) {
  if (seen.has(current)) throw new Error(`redirect loop at ${current}`);
  seen.add(current);

  const res = await fetch(current, { redirect: 'manual' });
  const location = res.headers.get('location');
  console.log(`${hop}: ${res.status} ${current} -> ${location ?? '(no Location)'}`);

  if (res.status < 300 || res.status >= 400 || !location) {
    console.log(`final: ${res.status} ${current}`);
    break;
  }
  current = new URL(location, current).toString();
}

new URL(location, current) correctly resolves a relative Location reference. In production code, add timeouts, cancellation, TLS-error handling, and an explicit policy for 3xx responses without a Location header.

Inspect a redirect in the browser

  1. Open Chrome, Edge, or Firefox DevTools and select the Network panel.
  2. Enable “Preserve log,” then load the starting URL in a new navigation.
  3. Click each document request and inspect its status, Location response header, request method, and timing.
  4. Disable the cache while DevTools is open if cached redirects could affect the result.
  5. Repeat while logged in or from the relevant region if the production problem occurs only in that context.

Browser inspection is essential when JavaScript navigation, HTML meta refresh, service workers, authentication, or cookies influence the path. A checker that follows only HTTP 3xx responses may not report those mechanisms.

Diagnose chains, loops, and bad endpoints

Redirect chains

A chain contains multiple redirect responses before the destination. For a permanent migration, map the old URL directly to the final preferred URL whenever possible. Google recommends keeping unavoidable chains low—ideally no more than three and fewer than five—and says Googlebot can follow up to 10 hops. The 10-hop ability is not a target; long chains add latency and some clients may not support them. See Google’s site-move guidance.

Loops

A loop occurs when a URL repeats, for example when HTTP redirects to HTTPS while another rule sends HTTPS back to HTTP, or when two canonicalization rules alternate hostnames. A tester should identify the repeated URL or stop at a hop cap. Confirm with cURL and the browser’s Network panel before changing rules.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Wrong or missing destinations

Check for a Location pointing to an unintended host, a relative path resolved against the wrong directory, a final 4xx/5xx response, or a redirect that drops required query parameters. A 3xx response without a usable destination is not a functioning redirect.

Permanent versus temporary migration signals

When a page has moved permanently and search results should use the new address, Google recommends a server-side permanent redirect such as 301 or 308. Temporary redirects communicate a different intent. Google treats redirect types as signals rather than absolute ranking guarantees; processing can vary by context. Details are in Google Search Central’s redirect documentation.

Migration checklist

  • Create a mapping from every old path to its intended final URL before changing rules.
  • Test HTTP and HTTPS, www and non-www hosts, trailing-slash variants, uppercase or normalized paths, and important query strings.
  • Prefer one direct server-side redirect to the final URL.
  • Update internal links, canonical tags, XML sitemaps, feeds, and campaign URLs to the preferred destination.
  • Check that each final page returns the expected status and that no redirect ends at a dead page or unrelated content.
  • Re-test authenticated, geographic, and mobile variants when those conditions change routing.

Why a checker can disagree with your browser

An automated service has its own user agent, method, cookies, headers, IP location, TLS stack, and cache. Servers can return a different redirect for a logged-in browser, a bot, or a visitor from another country. Record the request conditions alongside the result.

HTTP tracing also does not automatically execute JavaScript or every browser navigation mechanism. If the report and browser disagree, clear or bypass caches, reproduce the exact session in DevTools, and inspect service-worker and script activity. Do not conclude that a server rule is wrong solely from a request made in a different context.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How to choose a redirect-testing service

Compare these capabilities before relying on a hosted checker:

  • GET, HEAD, and custom-method support.
  • Every status and Location value, not only the final URL.
  • Configurable hop limits, loop detection, and relative-URL resolution.
  • Custom user agent, headers, cookies, authentication, and request region.
  • Clear handling of TLS errors, private destinations, timeouts, and 3xx responses without Location.
  • Whether JavaScript navigation or meta refresh is detected, and whether the result explains that scope.

For a single URL, cURL and DevTools may be sufficient. For a large migration, automate traces, store the status and destination for every hop, and alert on loops, unexpected hosts, and final 4xx/5xx responses.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If what you need is a clean visual capture of the destination rather than an HTTP diagnostic trace, ScreenshotNeo provides a one-call website screenshot API. It accepts the cookie or consent banner before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing result. Its MCP server lets Claude, Cursor, and other MCP clients use take_screenshot, get_page_info, and capture_pdf.

It does not replace a redirect trace: use the HTTP methods above to inspect each 3xx hop. Use ScreenshotNeo when you need to verify what the final page looks like after navigation and cleanup.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo documentation for options such as full-page capture, device and viewport settings, custom headers and cookies, waits, blocking, PDFs, signed links, asynchronous jobs, bulk capture, and usage reporting. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.

Common errors and fixes

“Too many redirects”

Look for a repeated URL, alternating scheme or host, cookie-dependent rules, or a proxy and origin applying conflicting redirects. Compare an unauthenticated cURL request with the real browser session.

The checker shows a different final URL

Compare method, headers, cookies, user agent, IP region, and cache state. A server can intentionally vary the response. Reproduce the same conditions in DevTools.

301 appears to become GET

This can be historical client behavior for 301 and 302. Test with the actual API client and use 307 or 308 when preserving the method is required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Relative destinations look incorrect

Resolve the Location reference against the current request URL according to RFC 9110; do not concatenate strings manually.

The page opens, but the trace ends in an error

The browser may be executing JavaScript, using a service worker, or supplying authentication that the checker lacks. Inspect the browser network log and test the same credentials and headers safely.

Frequently Asked Questions

Does a redirect tester crawl an entire website?

Usually no. A URL trace follows the URL or list of URLs you submit. Site-wide migration auditing requires a crawler or a script that feeds every old URL into the tracer.

Should I test with HEAD or GET?

Use GET for the closest match to an ordinary page navigation. HEAD is faster for header checks but some servers implement it differently; APIs and forms should be tested with their real method.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Can redirects expose private or internal URLs?

They can reveal destinations to the requester, but hosted services may block private networks or handle them differently. Do not submit confidential URLs or credentials unless the service’s documented security and access model meets your requirements.

Is a 301 always better than a 302?

No. Use a permanent status only when the move is intended to last. A temporary campaign, experiment, or short outage should communicate temporary behavior; method and client compatibility also matter.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read next

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.