I need to get the final URL after a page redirect preferably with curl or wget.
For example http://google.com may redirect to http://www.google.com
as another option:
$ curl -i http://google.com
HTTP/1.1 301 Moved Permanently
Location: http://www.google.com/
Content-Type: text/html; charset=UTF-8
Date: Sat, 19 Jun 2010 04:15:10 GMT
Expires: Mon, 19 Jul 2010 04:15:10 GMT
Cache-Control: public, max-age=2592000
Server: gws
Content-Length: 219
X-XSS-Protection: 1; mode=block
301 Moved
301 Moved
The document has moved
here.
But it doesn't go past the first one.