I'm looking for the most effecient way to resolve a given url to its final end point, following all 30x redirects and location headers.
Basically, I have a bunch of URLs like http://foo.com that when you go to them, they end up at a page like http://foo.com/Welcome.html and i need to find that last url.
right now, i'm using CURLOPT_FOLLOWLOCATION
and CURLOPT_NOBODY
(since i really dont care about the text returned)
and once its exec'd, i run curl_getinfo() and save the 'url' key from that array.
i just keep thinking that this is such a huge waste of <something>
and there is likely a better way.
EDIT: For those that read this later. I did end up finding a better solution (that didnt involve curl), see get_headers() in php5+