Last active
April 5, 2017 21:52
-
-
Save kernelsmith/c6c74f31f6c5dd97a6aa2bda881681aa to your computer and use it in GitHub Desktop.
follow a redirect at the command line
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -s -I $url | grep \^Location: | cut -d ':' -f 2- | |
# I had a longer version that continued following redirects up to a limit, but | |
# can't find it atm | |
# if you'd like to do the above anonymously, you can use https://hurl.it and | |
# change the HTTP method from GET to HEAD and paste in your URL (assuming HEAD | |
# is supported by the webserver). In the response you'll see the | |
# Location: HTTP header w/the redirected URL (assuming nominal situation). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment