cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Redirect option

From: Ralph Mitchell <ralphmitchell_at_gmail.com>
Date: Wed, 25 Jan 2006 16:27:31 -0600

Take a look at the man page for curl_easy_getinfo(). It has an option
CURLINFO_EFFECTIVE_URL that gets you the effective url of the page you
just fetched, after redirects and such have been processed. If the
relative url starts with a / (i.e. /header.html) you'll need to
replace everything after the hostname with the relative url. If the
relative url doesn't start with a /, just take the last component off
the effective url and add the relative url. Then go fetch the next
page.

Ralph Mitchell

On 1/25/06, Nicolas Escobar Jariton <nicoej_at_gmail.com> wrote:
> Hello everybody. I´m having problems with redirection because of the
> relative URL..
> For example, when I go to a web with frames it searches "header.html"
> and my server tries to lookup that file
> ("http://localhost/header.html")
>
> Is there a way to add the URL of the web I am entering, so instead of
> looking up in my localhost it looks up in the remote host?
>
> Thanks!!
>
> Nicolas.-
Received on 2006-01-25