Forum Moderators: coopster
I'm looking for a script to get the redirected URL.
For example:
- original url: http://www.example.com/rt.php?vd=imd0030382-0
- the redirected url: [us.example2.com...]
I would need the url in a php variable...
Any ideas?
[edited by: eelixduppy at 8:53 pm (utc) on Nov. 7, 2008]
[edit reason] exemplified [/edit]
header [ca3.php.net]("location:$url");
What I meant was is that I have a variable:
$url1 = 'http://www.example.com/rt.php?vd=imd0030382-0'
(http://www.example.com/rt.php is hosted on a different server and this page is redirect to a new url: [us.example2.com...]
How cam I get the new url into a variable? (url2 = 'http://us.example2.com/title/tt0029843/'; )
See [php.net...]
$headers=get_headers('http://www.example.com/rt.php?vd=imd0030382-0', 1);
print_r($headers);
[Pragma] => no-cache
[Content-Length] => 172
[Connection] => close
[Content-Type] => text/html
)
how do I get the second URL from this? (url2 = 'http://us.example2.com/title/tt0029843/'; )