[b]"How to Use curl Follow Redirect Verbose for Debugging?"[/b] or [b]"Why Isn't curl Follow Redirect Verbose Show

18 Replies, 1701 Views

"curl follow redirect verbose not showing all steps – what's up?"

Hey folks!

So I'm trying to debug some redirects with `curl follow redirect verbose`, but it's not showing *all* the hops. Like, it just skips some?

I'm using:
```bash
curl -v -L http://example.com
```
Shouldn't `-L` (follow redirect) + `-v` (verbose) show *every* redirect? Am I missing something obvious?

Also, is there a better way to track *exactly* where the request goes? Sometimes the output's a mess and hard to follow.

Thanks in advance! 🙏

(ps. yes, i checked man pages, still confused lol)
Hey! Yeah, curl follow redirect verbose can be a bit sneaky sometimes. The `-v` flag shows headers, but if you want *every* redirect step, try adding `--max-redirs 20` (or some high number) to make sure it doesn't bail early.

Also, `curl -v -L -w "%{url_effective}\n" http://example.com` might help—it prints the final URL after all hops.

For cleaner output, tools like `httpie` or even browser dev tools (Network tab) might be easier to follow.
Ugh, redirects are the worst. curl follow redirect verbose *should* show all steps, but sometimes intermediate hops get hidden if they’re super fast or cached.

Try `--proxy ""` to bypass any system proxy weirdness. Also, `strace -e trace=network curl -vL http://example.com` can show low-level network calls if you're *really* desperate.

Might be overkill, but hey, debugging is pain.
Pro tip: Use `curl -v -L --raw http://example.com` to avoid HTTP/2 compression messing with headers. Sometimes that hides redirect details.

If you’re on Linux, `tcpdump` or Wireshark can capture *everything*, but that’s nuclear option lol.

Also, check if the server’s sending `HSTS`—curl might skip steps if it’s forcing HTTPS silently.
curl follow redirect verbose not showing all steps? Classic.

Try `-D -` to dump headers to stdout, like:
```bash
curl -vL -D - http://example.com | grep -i "^Location:"
```
This’ll force you to see *every* Location header, even if curl’s being lazy.

Alternatively, `mitmproxy` is god-tier for tracing redirect chains visually.
Wait, are you sure the missing hops aren’t just relative redirects? curl follow redirect verbose *does* follow them, but the output might not highlight the full URL.

Try `--location-trusted` if the redirects involve auth or cookies. Also, `-i` includes response headers, which sometimes helps.

If all else fails, `curl --trace-ascii debug.log -L http://example.com` dumps *everything* to a file.
Dude, same issue here. curl follow redirect verbose is kinda hit or miss with 30X responses.

One hack: Chain `curl -v http://example.com`, then manually follow each `Location` header with a new curl. Tedious, but works.

Or just use Python `requests` with `allow_redirects=True` and print the `history`—way cleaner for debugging.
Yo! curl follow redirect verbose *usually* works, but some servers do shady stuff like meta-refresh or JS redirects (which curl ignores).

For a bulletproof trace, try `curl -vL --trace-time http://example.com`. The timestamps help untangle the mess.

Or, if you’re fancy, `burp suite` intercepts and maps every hop like a boss.
OP here—thanks y’all! Tried `--max-redirs 20` and `-w "%{url_effective}"`, and it’s *way* clearer now.

Still weird that curl follow redirect verbose hides some hops by default, but the `--trace-ascii` tip was golden.

Follow-up Q: Anyone know why curl doesn’t show *all* intermediate URLs by default? Like, is there a legit reason or just legacy code? 🤔
Fun fact: curl follow redirect verbose might skip hops if they’re circular (like A → B → A). It caps at 50 by default (`--max-redirs`).

For clarity, try `-sSLv` (silent but show errors + verbose). Or, if you’re lazy, `curl -vL 2>&1 | grep -E "(Location:|HTTP/)"` filters the noise.

`websniffer.cc` is also a neat online tool for visualizing redirects.



Users browsing this thread: 1 Guest(s)