[curl] Follow HTTP redirects

Created on November 30, 2026

Use -L to follow redirects. curl reads the URL in the Location header and sends a request to that destination.

curl -L https://example.com/

https://example.com/ is a placeholder. Replace it with a URL that returns a redirect to observe this behavior.

You can also use the long option name.

curl --location https://example.com/

Use --max-redirs to limit the number of redirects to follow.

curl -L --max-redirs 3 https://example.com/
curl Shell command