Source From Here
Question
I need to get the final url after a page redirect preferrably with curl or wget. For example http://google.com may redirect to http://www.google.com.
The contents are easy to get(ex. curl --max-redirs 10 http://google.com -L), but I'm only interested in the final url (in the former case http://www.google.com). Is there any way of doing this by using only linux buildin tools? (command line only)
How-To
curl's -w option and the sub variable url_effective is what you are looking for. Something like:
Question
I need to get the final url after a page redirect preferrably with curl or wget. For example http://google.com may redirect to http://www.google.com.
The contents are easy to get(ex. curl --max-redirs 10 http://google.com -L), but I'm only interested in the final url (in the former case http://www.google.com). Is there any way of doing this by using only linux buildin tools? (command line only)
How-To
curl's -w option and the sub variable url_effective is what you are looking for. Something like:
沒有留言:
張貼留言