Pages

Thursday, 14 August 2014

How to get the full redirect url in curl ?

curl’s -w option and the sub variable url_effective is what you are looking for.
Something like
curl -Ls -o /dev/null -w %{url_effective} http://google.com
More info
-L         Follow redirects
-s         Silent mode. Don't output anything
-o FILE    Write output to <file> instead of stdout
-w FORMAT  What to output after completion

No comments:

Post a Comment