cURL / Mailing Lists / curl-users / Single Mail

curl-users

Fwd: Curl sends me to main web page when it exists redirect.

From: mierdatutis mi <mmm286_at_gmail.com>
Date: Mon, 24 Oct 2016 13:22:33 +0200

thanks Daniel

When I put modifier -L it gives me home page. These is normal or maybe I'm
doing a bad sentence:

* SSLv3, TLS handshake, Finished (20):
{ [data not shown]
* SSL connection using TLSv1.2 / AES256-SHA
* Server certificate:
* subject: 1.3.6.1.4.1.311.60.2.1.3=ES; businessCategory=Private
Organization; serialNumber=A28581882; C=ES; ST=Madrid; L=Madrid; O=ALCAMPO
SA; OU=ALCAMPO SA; CN=www.alimentacion.alcampo.es
* start date: 2016-10-13 00:00:00 GMT
* expire date: 2017-10-10 23:59:59 GMT
* subjectAltName: www.alimentacion.alcampo.es matched
* issuer: C=US; O=GeoTrust Inc.; CN=GeoTrust EV SSL CA - G4
* SSL certificate verify ok.
> GET /tienda/index.php?cPath=651_95 HTTP/1.1
> Host: www.alimentacion.alcampo.es
> Accept: */*
> Referer:
> Cookie: osCsid=f9ff3147523a9cff79ed26c5fb0eeb49
> Connection: keep-alive
> User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101
Firefox/46.0
>
< HTTP/1.1 302 Found
< Date: Mon, 24 Oct 2016 03:39:14 GMT
* Server Apache is not blacklisted
< Server: Apache
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-check=0
< Pragma: no-cache
< Location: home.php
< Vary: Accept-Encoding,User-Agent
< Content-Length: 0
< Keep-Alive: timeout=1, max=200
< Connection: Keep-Alive
< Content-Type: text/html; charset=UTF-8
<
  0 0 0 0 0 0 0 0 --:--:-- --:--:--
--:--:-- 0
* Connection #0 to host www.alimentacion.alcampo.es left intact
* Issue another request to this URL: '
https://www.alimentacion.alcampo.es/tienda/home.php'
* Found bundle for host www.alimentacion.alcampo.es: 0x5507b430
* Re-using existing connection! (#0) with host www.alimentacion.alcampo.es
* Connected to www.alimentacion.alcampo.es (212.80.185.198) port 443 (#0)
> GET /tienda/home.php HTTP/1.1
> Host: www.alimentacion.alcampo.es
> Accept: */*
> Referer: https://www.alimentacion.alcampo.es/tienda/index.php?cPath=651_95
> Cookie: osCsid=f9ff3147523a9cff79ed26c5fb0eeb49
> Connection: keep-alive
> User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101
Firefox/46.0
>
< HTTP/1.1 200 OK
< Date: Mon, 24 Oct 2016 03:39:15 GMT
* Server Apache is not blacklisted
< Server: Apache
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-check=0
< Pragma: no-cache
< Vary: Accept-Encoding,User-Agent
< Keep-Alive: timeout=1, max=199
< Connection: Keep-Alive
< Transfer-Encoding: chunked
< Content-Type: text/html; charset=UTF-8
<
{ [data not shown]
100 41228 0 41228 0 0 130k 0 --:--:-- --:--:-- --:--:--
1269k
* Connection #0 to host www.alimentacion.alcampo.es left intact
+ response=200

Could be that I have 302 code because session was expired or something like
that?
Thanks

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 23 Oct 2016 23:34:34 +0200 (CEST)
On Sun, 23 Oct 2016, mierdatutis mi wrote:
> I'm downloading every some time a url of website. Everything is ok but
> sometimes it gives me an 302 error and the website redirect me to main
web
> page. There is some way to can go to the url that I like or that the
> redirect finish in the webpage that I'm searching.
The server decides what to respond with and curl just acts on what the
server
says. If the server responds with a 302, then there's no alternative action
for curl to do.
You can ask curl to follow that direct by using -L, --location.

-- 
Hi,
I'm downloading every some time a url of website. Everything is ok but
sometimes it gives me an 302 error and the website redirect me to main web
page. There is some way to can go to the url that I like or that the
redirect finish in the webpage that I'm searching.
Thanks and sorry form y English!
These is the log:
ww.alimentacion.alcampo.es
* start date: 2016-10-13 00:00:00 GMT
* expire date: 2017-10-10 23:59:59 GMT
* subjectAltName: www.alimentacion.alcampo.es matched
* issuer: C=US; O=GeoTrust Inc.; CN=GeoTrust EV SSL CA - G4
* SSL certificate verify ok.
> GET /tienda/index.php?cPath=651_95_951 HTTP/1.1^M
> Host: www.alimentacion.alcampo.es^M
> Accept: */*^M
> Referer: ^M
> Connection: keep-alive^M
> User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101
Firefox/46.0^M
> ^M
< HTTP/1.1 302 Found^M
< Date: Sat, 22 Oct 2016 21:33:56 GMT^M
* Serve

-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-users
FAQ: https://curl.haxx.se/docs/faq.html
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-10-24