cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: following server redirections

From: C.Alvarez <carlos_at_ref2000.com>
Date: Wed, 22 Jun 2005 10:58:00 +0200

OK so if I understand,
- 301 or 302 returns are OK for curl

- meta refresh must be parsed

- About URL rewriting ? I wasn't able to test that, how should this be
handled (Can curl handle it ) ?

----- Original Message -----
From: "Dan Fandrich" <dan_at_coneharvesters.com>
To: <curl-library_at_cool.haxx.se>
Sent: Tuesday, June 21, 2005 7:43 PM
Subject: Re: following server redirections

> On Tue, Jun 21, 2005 at 04:27:46PM +0200, C.Alvarez wrote:
> > Hello,
> >
> > How does the redirection following is made ? Is this library able to
follow 301
> > or 302 server redirections ?
>
> Yes.
>
> > I have tried setting this
> >
> > curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
> > curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 1);
> > curl_easy_setopt(curl, CURLOPT_UNRESTRICTED_AUTH, 1);
> >
> > But this doesn't seems to redirect my page.
> > here the testing url I have tried
http://www.shopzilla.fr/mkt.xpml?mkt_id=
> > 25925767
>
> This URL doesn't result in a 301 or 302 redirect code--it results in a 200
OK
> code with an HTML body containing an application-level
> <META HTTP-EQUIV="refresh" ...> tag.
>
> > Should I need to read the headers to get the redirections ?
>
> It's not in the headers in this case. You'll have to parse the HTML
> in your application in order to follow the redirect.
>
> >>> Dan
> --
> http://www.MoveAnnouncer.com The web change of address
service
> Let webmasters know that your web site has moved
>
Received on 2005-06-22