Follow a URL's Redirect Chain with curl
Reveal every hop a short link or http:// address passes through before reaching the final page.
Run `curl -sIL -A "Mozilla/5.0" "http://example.com"` to print the Location headers of each redirect.
01Command
Command
$ curl -sIL -A "Mozilla/5.0" "http://example.com"02What it does
Redirect-checking is a quick safety step before clicking a suspicious short link: each block of output shows one hop's status code and where it points next. -I fetches only headers, -L makes curl follow each redirect, and the User-Agent keeps some sites from serving odd responses to curl. The final block shows the real destination and whether it uses HTTPS.
03Risk
!Warning: This only requests headers, but the destination server still sees your request — do not run it against anything you would not open.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- curl — transfer a URL (macOS man page)Evidence: Documents -I to fetch headers only, -L to follow redirects, and -A to set the User-Agent string.
Last verified: 2026-09-18 · Category: Network