cURL / Mailing Lists / curl-users / Single Mail


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

From: Daniel Stenberg <>
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.

List admin:
Received on 2016-10-23