URL 콘텐츠 검색 및 리디렉션 따르기

URL 콘텐츠 검색 및 리디렉션 따르기

CentOS에서 URL에 액세스한 다음 자동으로 리디렉션을 따르고 싶습니다. 예를 들면 다음과 같습니다.

Visit http://domain.com
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.

이 목표를 어떻게 달성할 수 있나요?

답변1

curl -L http://domain.com

-L/--location
(HTTP/HTTPS) 서버가 요청한 페이지가 다른 위치(Location: 헤더 및 3XX 응답 코드로 표시됨)로 이동했다고 보고하는 경우 이 옵션을 사용하면 컬이 새 위치에서 요청을 다시 실행하게 됩니다.

또는wget http://domain.com

관련 정보