Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I want to visit an URL in CentOS and then automatically follow the redirects. So, for example:

This will redirect my by a `header()` to another webpage, so automatically follow this redirect.
And this page will also redirect me.
Save the contents on the `landing` page.

How do I accomplish this?

share|improve this question

migrated from Nov 28 '11 at 20:38

This question came from our site for system and network administrators.

Wget does this automatically. – mailq Nov 28 '11 at 20:37

1 Answer 1

curl -L

(HTTP/HTTPS) If the server reports that the requested page has moved to a different location (indicated with a Location: header and a 3XX response code), this option will make curl redo the request on the new place.

or wget

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.