CURLOPT_FOLLOWLOCATION TRUE to follow any header "Location:" sent by the server in its response (note that this happens is recursive, PHP will follow all send header "Location: ", except in the case when a constant CURLOPT_MAXREDIRS).
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);