The problem is this, I can get the page to load from a remote source with altered links but once I follow the link I have no idea how to find out where I am. This is especially true if the link I followed is a redirected url as is common on the yahoo homepage.
So, if I click on a link like http://www.yahoo.com/s/42481, it will take me to sports.yahoo.com/ncaab. Is there a way in PHP to determine that http://www.yahoo.com/s/42481 redirects to sports.yahoo.com/ncaab?
I need to be able to follow a redirect and return the destination programatically using php. I need to write a function that works like this:
Code: Select all
function followRedirect ($given_url){
[some php magic]
return $redirected_url;
}