I have tens of thousands of links. All links will redirect visitors to
another URL (the real URL). I want to know the real URLs behind those
redirecting URLs.
I just wrote a small piece of code to do it:
$result = HTTP::head($lin k);
if (PEAR::isError( $result)) {
echo "Error: " . $result->getMessage()." <br>";
} else {
$chunks=split(' %2F',$result['Location']);
echo "\t".$chunk s['2'].'<br>';
}
It works, but it is simply too slow to get the real (destination) URLs
for tens of thousands of redirecting URLs.
Is there a fast way to do that?
Thanks,
another URL (the real URL). I want to know the real URLs behind those
redirecting URLs.
I just wrote a small piece of code to do it:
$result = HTTP::head($lin k);
if (PEAR::isError( $result)) {
echo "Error: " . $result->getMessage()." <br>";
} else {
$chunks=split(' %2F',$result['Location']);
echo "\t".$chunk s['2'].'<br>';
}
It works, but it is simply too slow to get the real (destination) URLs
for tens of thousands of redirecting URLs.
Is there a fast way to do that?
Thanks,
Comment