I know that when I set CURLOPT_FOLLOWLOCATION to true, cURL will follow the Location header and redirect to new page. But is it possible only to get header of the new page without actually redirecting there? Or is it not possible?
I know that when I set CURLOPT_FOLLOWLOCATION to true, cURL will follow the Location
Share
No. You’d have to disable
FOLLOWLOCATION, extract the redirect URL from the response, and then issue a new HEAD request with that URL.