What happens when PHP’s CURL library encounters a 301 Redirect header? It depends.
By default, it does NOT redirect. It will simply halt after the header is returned.
However, there is an option you can set that allows it to follow up to 5 redirects in a chain: the CURLOPT_FOLLOWLOCATION setting.
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
Hope that helps anyone else out there that was curious!
Leave a Reply