Is there a way to follow redirects with command line cURL?
I know that in a php script: curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); will follow redirects. Is there a way to follow redirects with command line cURL? Use the location header flag: curl -L <URL> user3817445 I had a similar problem. I am posting my solution here because I believe it might help one of the commenters. For me, the obstacle was that the page required a login and then gave me a new URL through javascript. Here is what I had to do: curl -c cookiejar -g -O -J -L -F "j_username=yourusename" -F "j_password=yourpassword" <URL> Note that j_username and j_password is the name of