views:

273

answers:

3

How do I prevent wget from following redirects?

+1  A: 

--max-redirect 0

I haven't tried this, it will either allow none or allow infinite..

Matt
I think you can also do --level=1 or -l=1 to do 1 level of redirection. --level=0 is the same as --level=inf, which is infinite.
MJB
A: 

Some versions of wget have a --max-redirect option: See here

Pekka
my doesn't have :(
flybywire
A: 

Use curl without -L instead of wget.

Dennis Williamson