cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: Not able to follow redirections

From: Gowranga <gowranga_at_serc.iisc.ernet.in>
Date: Thu, 14 Jun 2007 08:35:45 +0530 (IST)

> On Thu, 14 Jun 2007, Gowranga wrote:
>
>> I am sorry, I have shown the wrong output. In order to capture the html
>> output, I had tried "-o page.html" option, and so missed out the
>> following
>> portion:
>
> Then all is good. You got the HTML output, proving the redirect worked and
> the
> headers you now showed also proved a 302 response and a following
> subsequent
> request to the new URL that then got a 200 back.
>
> IOW, the redirect handling in curl seems to work fine...
>
> Now, can you show us the same kind of request and repsonse headers from
> when
> you run your PHP program?

The php file resides under https://my.ip.add.ress/google, and is
accessible via authorization. My requirement is, when I hit this site, it
should redirect me to the google site. Following are the headers received
while attempting to access

https://my.ip.add.ress/google/images/hp0.gif

GET /google/images/hp0.gif HTTP/1.1
Host: my.ip.add.ress
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.13)
Gecko/20060414
Accept: image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: https://my.ip.add.ress/google
Authorization: Basic Zmx1ZW50X3VzZXI6dHJ5XzVmdA==

HTTP/1.x 404 Not Found
Date: Thu, 14 Jun 2007 02:33:17 GMT
Server: Apache/2.0.59 (Unix)
Content-Length: 296
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=iso-8859-1
https://my.ip.add.ress/google/images/hp0.gif

GET /google/images/hp0.gif HTTP/1.1
Host: my.ip.add.ress
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.13)
Gecko/20060414
Accept: image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: https://my.ip.add.ress/google
Authorization: Basic Zmx1ZW50X3VzZXI6dHJ5XzVmdA==

HTTP/1.x 404 Not Found
Date: Thu, 14 Jun 2007 02:33:17 GMT
Server: Apache/2.0.59 (Unix)
Content-Length: 296
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=iso-8859-1

Thanks

-gowranga
>
> --
> Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2007-06-14