     [Answers](https://scrapfly.io/blog)   /  [curl](https://scrapfly.io/blog/tag/curl)   /  [How to Follow Redirects In cURL?](https://scrapfly.io/blog/answers/how-to-follow-redirects-in-curl)   # How to Follow Redirects In cURL?

 by [Mazen Ramadan](https://scrapfly.io/blog/author/mazen) Apr 18, 2026 1 min read [\#curl](https://scrapfly.io/blog/tag/curl) 

 [  ](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-follow-redirects-in-curl "Share on LinkedIn")    

 

 

Redirects are a fundamental concept of the HTTP protocols, allowing requests to get turned to other resources containing the desired data.

By default, cURL commands don't follow redirects. For example, let's attempt to request [httpbin.dev/absolute-redirect/:n](https://httpbin.dev/absolute-redirect/:1). It redirects the request for x number of times:

shell```shell
curl https://httpbin.dev/absolute-redirect/6
```



Executing the above command will return nothing, as the request didn't proceed to its final destination. **To make cURL follow redirects**, we can use the `-L` or `--location`:

shell```shell
curl -L https://httpbin.dev/absolute-redirect/6
```



The above cURL request will follow the redirects 6 times and finally return a response:

shell```shell
{
  "args": {},
  "headers": {
    "Accept": [
      "*/*"
    ],
    "Accept-Encoding": [
      "gzip"
    ],
    "Host": [
      "httpbin.dev"
    ],
    "User-Agent": [
      "curl/8.4.0"
    ]
  },
  "url": "https://httpbin.dev/get"
}
```



By default, the `-L` or `--location` cURL options enable redirects following for a maximum of 50 times. To override the redirects limit, we can use the `--max-redirs` cURL option:

shell```shell
curl -L https://httpbin.dev/absolute-redirect/51 --max-redirs 51
```



For more details on cURL, refer to our previous guide.

[How to Use cURL For Web ScrapingIn this article, we'll go over a step-by-step guide on sending and configuring HTTP requests with cURL. We'll also explore advanced usages of cURL for web scraping, such as scraping dynamic pages and avoiding getting blocked.](https://scrapfly.io/blog/posts/how-to-use-curl-for-web-scraping)



 

    



Scale Your Web Scraping

Anti-bot bypass, browser rendering, and rotating proxies, all in one API. Start with 1,000 free credits.

  No credit card required  1,000 free API credits  Anti-bot bypass included 

 [Start Free](https://scrapfly.io/register) [View Docs](https://scrapfly.io/docs/onboarding) 

 Not ready? Get our newsletter instead. 

 

## Explore this Article with AI

 [ ChatGPT ](https://chat.openai.com/?q=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-follow-redirects-in-curl) [ Gemini ](https://www.google.com/search?udm=50&aep=11&q=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-follow-redirects-in-curl) [ Grok ](https://x.com/i/grok?text=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-follow-redirects-in-curl) [ Perplexity ](https://www.perplexity.ai/search/new?q=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-follow-redirects-in-curl) [ Claude ](https://claude.ai/new?q=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fhow-to-follow-redirects-in-curl) 



 ## Related Articles

 [  

 curl 

### How to Use cURL GET Requests

Here's everything you need to know about cURL GET requests and some common pitfalls you should avoid.

 

 ](https://scrapfly.io/blog/posts/how-to-use-curl-get-requests) [  

 http tools 

### How to Use cURL For Web Scraping

In this article, we'll go over a step-by-step guide on sending and configuring HTTP requests with cURL. We'll also explo...

 

 ](https://scrapfly.io/blog/posts/how-to-use-curl-for-web-scraping) [     

### What is HTTP 405 Error? (Method Not Allowed)

HTTP error codes can be confusing, especially when they disrupt your web scraping or automation tasks. One such error is...

 

 ](https://scrapfly.io/blog/posts/what-is-http-405-error) 

  ## Related Questions

- [ Q How To Use Proxy With cURL? ](https://scrapfly.io/blog/answers/how-to-use-proxy-with-curl)
- [ Q How to Copy as cURL With Brave? ](https://scrapfly.io/blog/answers/how-to-copy-as-curl-with-brave)
- [ Q How to Copy as cURL With Safari? ](https://scrapfly.io/blog/answers/how-to-copy-as-curl-with-safari)
- [ Q How to Copy as cURL With Edge? ](https://scrapfly.io/blog/answers/how-to-copy-as-curl-with-edge)
 
  



   



 Scale your web scraping effortlessly, **1,000 free credits** [Start Free](https://scrapfly.io/register)