Home / Guides / How to Check HTTP Status Codes and Redirects in Bulk

Updated

How to Check HTTP Status Codes and Redirects in Bulk

To check HTTP status codes in bulk, request each URL, follow its redirects hop by hop and record the first status, every redirect, the final URL and the final status. With curl, curl -sIL shows the full chain for one URL; a loop handles a few dozen. Separate 404/410 and DNS failures (broken) from 401/403/429 (refused) and 5xx (retry later). For hundreds or thousands of URLs, a bulk checker returns one JSON row per URL with the verdict, final URL and redirect hops.

1. One URL with curl

curl -sIL --max-time 10 http://python.org | grep -i -E '^(HTTP|location)'

Each HTTP/ line is one hop and each location line says where it goes next. Some servers answer HEAD differently from GET; if the result looks odd, repeat with curl -sL -o /dev/null -D -.

2. A short list in a loop

while read u; do
  curl -s -o /dev/null -L --max-time 10 \
    -w '%{http_code} %{num_redirects} %{url_effective} '"$u"'\n' "$u"
done < urls.txt

Prints the final code, the number of redirects, the final URL and the original URL. A 000 code means no answer at all: DNS failure, refused connection or timeout.

3. What real URLs return (measured 2 December 2026)

Eight URLs checked in one run of our bulk checker, 1.7 s in total: http://python.org, http://github.com, http://apify.com and http://djangoproject.com each answer 200 after one 301 to HTTPS (and to www for python.org and djangoproject.com); http://wikipedia.org takes two 301 hops (HTTPS, then www); the retired docs.python.org/2/library/urllib2.html still answers 200 directly; a missing python.org page answers 404; a domain that does not exist fails DNS. Response times ranged from 84 to 209 ms. Even big sites run redirect chains: link to the final URL.

4. Which codes matter

5. Hundreds or thousands of URLs

Plainprobe Bulk URL Status & Redirect Checker returns, for each URL, the status, a verdict (ok, broken, refused, server_error, error), the final URL, every redirect hop, the content type and the response time as JSON, at $0.0005 per URL. Private and internal addresses are blocked. To get the URL list of a site first, see find all pages of a website; to find broken links inside pages, see find broken links.

Limits to keep in mind

FAQ

How do I check the HTTP status code of a URL?

Run curl -s -o /dev/null -w '%{http_code}' URL for the final code, or curl -sIL URL to see every hop of the redirect chain. For hundreds of URLs, use a bulk checker that returns the status, final URL and each redirect hop as JSON.

How do I check where a URL redirects?

Follow the Location header of each 3xx answer until a non-redirect status: curl -sIL URL | grep -i -E '^(HTTP|location)' prints every hop. Count the hops: more than one is a chain worth fixing.

Is a 301 redirect bad for SEO?

No, a single 301 passes the page's value to the new URL. Chains of several redirects, redirect loops and links that keep pointing to the old URL waste crawl budget and slow visitors down.

Why does a URL work in my browser but fail in a checker?

Some servers refuse automated requests with 401, 403 or 429, or need cookies or JavaScript. Treat these as refused checks rather than broken pages.

Related tool