![URL 콘텐츠 검색 및 리디렉션 따르기](https://linux55.com/image/19198/URL%20%EC%BD%98%ED%85%90%EC%B8%A0%20%EA%B2%80%EC%83%89%20%EB%B0%8F%20%EB%A6%AC%EB%94%94%EB%A0%89%EC%85%98%20%EB%94%B0%EB%A5%B4%EA%B8%B0.png)
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