If a given URL is redirected to another one, cURL will fetch the last one by
cURL
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
b
You can use curl_getinfo().
curl_getinfo()
http://php.net/manual/en/function.curl-getinfo.php
echo curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);