curl-library
Re: Another redirect question
From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 22 Jul 2003 09:28:07 +0200 (CEST)
Date: Tue, 22 Jul 2003 09:28:07 +0200 (CEST)
On Mon, 21 Jul 2003, Mark Fletcher wrote:
> Is there a way, when using FOLLOWLOCATION and the server returns 301 (moved
> permanently), to get that status back and the final (redirected to) url? I'd
> like our crawler to be able to update our database whenever a RSS url
> changes location permanently.
The only current way to do this that I can think of, is to fetch all headers
using the header callback and then parse those yourself to get the full
"chain" of HTTP codes within a series of "Location:" followings.
Then you can use curl_easy_getinfo(CURLINFO_EFFECTIVE_URL) to get the last
used URL.
-- Daniel Stenberg -- curl: been grokking URLs since 1998 ------------------------------------------------------- This SF.net email is sponsored by: VM Ware With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here: http://www.vmware.com/wl/offer/345/0Received on 2003-07-22