How do I display all URLs in a redirect chain?
Clash Royale CLAN TAG#URR8PPP
up vote
15
down vote
favorite
I'm looking for a way to show all of the URLs in a redirect chain, preferably from the shell. I've found a way to almost do it with curl, but it only shows the first and last URL. I'd like to see all of them.
There must be a way to do this simply, but I can't for the life of me find what it is.
Edit: Since submitting this I've found out how to do it with Chrome (CTRL+SHIFT+I->Network tab). But, I'd still like to know how it can be done from the Linux command line.
wget curl
add a comment |Â
up vote
15
down vote
favorite
I'm looking for a way to show all of the URLs in a redirect chain, preferably from the shell. I've found a way to almost do it with curl, but it only shows the first and last URL. I'd like to see all of them.
There must be a way to do this simply, but I can't for the life of me find what it is.
Edit: Since submitting this I've found out how to do it with Chrome (CTRL+SHIFT+I->Network tab). But, I'd still like to know how it can be done from the Linux command line.
wget curl
add a comment |Â
up vote
15
down vote
favorite
up vote
15
down vote
favorite
I'm looking for a way to show all of the URLs in a redirect chain, preferably from the shell. I've found a way to almost do it with curl, but it only shows the first and last URL. I'd like to see all of them.
There must be a way to do this simply, but I can't for the life of me find what it is.
Edit: Since submitting this I've found out how to do it with Chrome (CTRL+SHIFT+I->Network tab). But, I'd still like to know how it can be done from the Linux command line.
wget curl
I'm looking for a way to show all of the URLs in a redirect chain, preferably from the shell. I've found a way to almost do it with curl, but it only shows the first and last URL. I'd like to see all of them.
There must be a way to do this simply, but I can't for the life of me find what it is.
Edit: Since submitting this I've found out how to do it with Chrome (CTRL+SHIFT+I->Network tab). But, I'd still like to know how it can be done from the Linux command line.
wget curl
wget curl
edited 37 mins ago
asked Jul 14 '15 at 23:32
felwithe
178118
178118
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
20
down vote
accepted
How about simply using wget
?
$ wget http://picasaweb.google.com 2>&1 | grep Location:
Location: /home [following]
Location: https://www.google.com/accounts/ServiceLogin?hl=en_US&continue=https%3A%2F%2Fpicasaweb.google.com%2Flh%2Flogin%3Fcontinue%3Dhttps%253A%252F%252Fpicasaweb.google.com%252Fhome&service=lh2<mpl=gp&passive=true [following]
Location: https://accounts.google.com/ServiceLogin?hl=en_US&continue=https%3A%2F%2Fpicasaweb.google.com%2Flh%2Flogin%3Fcontinue%3Dhttps%3A%2F%2Fpicasaweb.google.com%2Fhome&service=lh2<mpl=gp&passive=true [following]
curl -v
also shows some info, but looks not as useful as wget
.
$ curl -v -L http://picasaweb.google.com 2>&1 | egrep "^> (Host:|GET)"
> GET / HTTP/1.1
> Host: picasaweb.google.com
> GET /home HTTP/1.1
> Host: picasaweb.google.com
> GET /accounts/ServiceLogin?hl=en_US&continue=https%3A%2F%2Fpicasaweb.google.com%2Flh%2Flogin%3Fcontinue%3Dhttps%253A%252F%252Fpicasaweb.google.com%252Fhome&service=lh2<mpl=gp&passive=true HTTP/1.1
> Host: www.google.com
> GET /ServiceLogin?hl=en_US&continue=https%3A%2F%2Fpicasaweb.google.com%2Flh%2Flogin%3Fcontinue%3Dhttps%253A%252F%252Fpicasaweb.google.com%252Fhome&service=lh2<mpl=gp&passive=true HTTP/1.1
> Host: accounts.google.com
That looks like it'll do it. I'm just curious though, why did you send STDERR to STDOUT?
â felwithe
Jul 15 '15 at 10:12
1
If I'm not mistaken, it will only work for redirection using the location header, not for 301 http codes
â greg
Mar 3 '17 at 10:29
1
I cannot reproduce the wget example. Returns "503: Service Unavailable." - Maybe they are blocking the wget but not the curl http-user-agent? Is this just me?
â StackzOfZtuff
Nov 17 '17 at 12:01
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
20
down vote
accepted
How about simply using wget
?
$ wget http://picasaweb.google.com 2>&1 | grep Location:
Location: /home [following]
Location: https://www.google.com/accounts/ServiceLogin?hl=en_US&continue=https%3A%2F%2Fpicasaweb.google.com%2Flh%2Flogin%3Fcontinue%3Dhttps%253A%252F%252Fpicasaweb.google.com%252Fhome&service=lh2<mpl=gp&passive=true [following]
Location: https://accounts.google.com/ServiceLogin?hl=en_US&continue=https%3A%2F%2Fpicasaweb.google.com%2Flh%2Flogin%3Fcontinue%3Dhttps%3A%2F%2Fpicasaweb.google.com%2Fhome&service=lh2<mpl=gp&passive=true [following]
curl -v
also shows some info, but looks not as useful as wget
.
$ curl -v -L http://picasaweb.google.com 2>&1 | egrep "^> (Host:|GET)"
> GET / HTTP/1.1
> Host: picasaweb.google.com
> GET /home HTTP/1.1
> Host: picasaweb.google.com
> GET /accounts/ServiceLogin?hl=en_US&continue=https%3A%2F%2Fpicasaweb.google.com%2Flh%2Flogin%3Fcontinue%3Dhttps%253A%252F%252Fpicasaweb.google.com%252Fhome&service=lh2<mpl=gp&passive=true HTTP/1.1
> Host: www.google.com
> GET /ServiceLogin?hl=en_US&continue=https%3A%2F%2Fpicasaweb.google.com%2Flh%2Flogin%3Fcontinue%3Dhttps%253A%252F%252Fpicasaweb.google.com%252Fhome&service=lh2<mpl=gp&passive=true HTTP/1.1
> Host: accounts.google.com
That looks like it'll do it. I'm just curious though, why did you send STDERR to STDOUT?
â felwithe
Jul 15 '15 at 10:12
1
If I'm not mistaken, it will only work for redirection using the location header, not for 301 http codes
â greg
Mar 3 '17 at 10:29
1
I cannot reproduce the wget example. Returns "503: Service Unavailable." - Maybe they are blocking the wget but not the curl http-user-agent? Is this just me?
â StackzOfZtuff
Nov 17 '17 at 12:01
add a comment |Â
up vote
20
down vote
accepted
How about simply using wget
?
$ wget http://picasaweb.google.com 2>&1 | grep Location:
Location: /home [following]
Location: https://www.google.com/accounts/ServiceLogin?hl=en_US&continue=https%3A%2F%2Fpicasaweb.google.com%2Flh%2Flogin%3Fcontinue%3Dhttps%253A%252F%252Fpicasaweb.google.com%252Fhome&service=lh2<mpl=gp&passive=true [following]
Location: https://accounts.google.com/ServiceLogin?hl=en_US&continue=https%3A%2F%2Fpicasaweb.google.com%2Flh%2Flogin%3Fcontinue%3Dhttps%3A%2F%2Fpicasaweb.google.com%2Fhome&service=lh2<mpl=gp&passive=true [following]
curl -v
also shows some info, but looks not as useful as wget
.
$ curl -v -L http://picasaweb.google.com 2>&1 | egrep "^> (Host:|GET)"
> GET / HTTP/1.1
> Host: picasaweb.google.com
> GET /home HTTP/1.1
> Host: picasaweb.google.com
> GET /accounts/ServiceLogin?hl=en_US&continue=https%3A%2F%2Fpicasaweb.google.com%2Flh%2Flogin%3Fcontinue%3Dhttps%253A%252F%252Fpicasaweb.google.com%252Fhome&service=lh2<mpl=gp&passive=true HTTP/1.1
> Host: www.google.com
> GET /ServiceLogin?hl=en_US&continue=https%3A%2F%2Fpicasaweb.google.com%2Flh%2Flogin%3Fcontinue%3Dhttps%253A%252F%252Fpicasaweb.google.com%252Fhome&service=lh2<mpl=gp&passive=true HTTP/1.1
> Host: accounts.google.com
That looks like it'll do it. I'm just curious though, why did you send STDERR to STDOUT?
â felwithe
Jul 15 '15 at 10:12
1
If I'm not mistaken, it will only work for redirection using the location header, not for 301 http codes
â greg
Mar 3 '17 at 10:29
1
I cannot reproduce the wget example. Returns "503: Service Unavailable." - Maybe they are blocking the wget but not the curl http-user-agent? Is this just me?
â StackzOfZtuff
Nov 17 '17 at 12:01
add a comment |Â
up vote
20
down vote
accepted
up vote
20
down vote
accepted
How about simply using wget
?
$ wget http://picasaweb.google.com 2>&1 | grep Location:
Location: /home [following]
Location: https://www.google.com/accounts/ServiceLogin?hl=en_US&continue=https%3A%2F%2Fpicasaweb.google.com%2Flh%2Flogin%3Fcontinue%3Dhttps%253A%252F%252Fpicasaweb.google.com%252Fhome&service=lh2<mpl=gp&passive=true [following]
Location: https://accounts.google.com/ServiceLogin?hl=en_US&continue=https%3A%2F%2Fpicasaweb.google.com%2Flh%2Flogin%3Fcontinue%3Dhttps%3A%2F%2Fpicasaweb.google.com%2Fhome&service=lh2<mpl=gp&passive=true [following]
curl -v
also shows some info, but looks not as useful as wget
.
$ curl -v -L http://picasaweb.google.com 2>&1 | egrep "^> (Host:|GET)"
> GET / HTTP/1.1
> Host: picasaweb.google.com
> GET /home HTTP/1.1
> Host: picasaweb.google.com
> GET /accounts/ServiceLogin?hl=en_US&continue=https%3A%2F%2Fpicasaweb.google.com%2Flh%2Flogin%3Fcontinue%3Dhttps%253A%252F%252Fpicasaweb.google.com%252Fhome&service=lh2<mpl=gp&passive=true HTTP/1.1
> Host: www.google.com
> GET /ServiceLogin?hl=en_US&continue=https%3A%2F%2Fpicasaweb.google.com%2Flh%2Flogin%3Fcontinue%3Dhttps%253A%252F%252Fpicasaweb.google.com%252Fhome&service=lh2<mpl=gp&passive=true HTTP/1.1
> Host: accounts.google.com
How about simply using wget
?
$ wget http://picasaweb.google.com 2>&1 | grep Location:
Location: /home [following]
Location: https://www.google.com/accounts/ServiceLogin?hl=en_US&continue=https%3A%2F%2Fpicasaweb.google.com%2Flh%2Flogin%3Fcontinue%3Dhttps%253A%252F%252Fpicasaweb.google.com%252Fhome&service=lh2<mpl=gp&passive=true [following]
Location: https://accounts.google.com/ServiceLogin?hl=en_US&continue=https%3A%2F%2Fpicasaweb.google.com%2Flh%2Flogin%3Fcontinue%3Dhttps%3A%2F%2Fpicasaweb.google.com%2Fhome&service=lh2<mpl=gp&passive=true [following]
curl -v
also shows some info, but looks not as useful as wget
.
$ curl -v -L http://picasaweb.google.com 2>&1 | egrep "^> (Host:|GET)"
> GET / HTTP/1.1
> Host: picasaweb.google.com
> GET /home HTTP/1.1
> Host: picasaweb.google.com
> GET /accounts/ServiceLogin?hl=en_US&continue=https%3A%2F%2Fpicasaweb.google.com%2Flh%2Flogin%3Fcontinue%3Dhttps%253A%252F%252Fpicasaweb.google.com%252Fhome&service=lh2<mpl=gp&passive=true HTTP/1.1
> Host: www.google.com
> GET /ServiceLogin?hl=en_US&continue=https%3A%2F%2Fpicasaweb.google.com%2Flh%2Flogin%3Fcontinue%3Dhttps%253A%252F%252Fpicasaweb.google.com%252Fhome&service=lh2<mpl=gp&passive=true HTTP/1.1
> Host: accounts.google.com
answered Jul 15 '15 at 2:37
yaegashi
8,01611532
8,01611532
That looks like it'll do it. I'm just curious though, why did you send STDERR to STDOUT?
â felwithe
Jul 15 '15 at 10:12
1
If I'm not mistaken, it will only work for redirection using the location header, not for 301 http codes
â greg
Mar 3 '17 at 10:29
1
I cannot reproduce the wget example. Returns "503: Service Unavailable." - Maybe they are blocking the wget but not the curl http-user-agent? Is this just me?
â StackzOfZtuff
Nov 17 '17 at 12:01
add a comment |Â
That looks like it'll do it. I'm just curious though, why did you send STDERR to STDOUT?
â felwithe
Jul 15 '15 at 10:12
1
If I'm not mistaken, it will only work for redirection using the location header, not for 301 http codes
â greg
Mar 3 '17 at 10:29
1
I cannot reproduce the wget example. Returns "503: Service Unavailable." - Maybe they are blocking the wget but not the curl http-user-agent? Is this just me?
â StackzOfZtuff
Nov 17 '17 at 12:01
That looks like it'll do it. I'm just curious though, why did you send STDERR to STDOUT?
â felwithe
Jul 15 '15 at 10:12
That looks like it'll do it. I'm just curious though, why did you send STDERR to STDOUT?
â felwithe
Jul 15 '15 at 10:12
1
1
If I'm not mistaken, it will only work for redirection using the location header, not for 301 http codes
â greg
Mar 3 '17 at 10:29
If I'm not mistaken, it will only work for redirection using the location header, not for 301 http codes
â greg
Mar 3 '17 at 10:29
1
1
I cannot reproduce the wget example. Returns "503: Service Unavailable." - Maybe they are blocking the wget but not the curl http-user-agent? Is this just me?
â StackzOfZtuff
Nov 17 '17 at 12:01
I cannot reproduce the wget example. Returns "503: Service Unavailable." - Maybe they are blocking the wget but not the curl http-user-agent? Is this just me?
â StackzOfZtuff
Nov 17 '17 at 12:01
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f216042%2fhow-do-i-display-all-urls-in-a-redirect-chain%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password