0

I am trying to get the header url of the url the redirect me to a different page. I am not interested on the original referrer, my goal is to pull out the url of the landing page of the url I input. Below is an example of url that redirects me to different location. I have tried doing the code below but still no luck, it is just giving me errors

<?php
$url = "http://gateway.play44.net:3010/old/videos/one-punch_man_-_03.mp4?st=xV6C9jBU17ALqrMSAWriLA&e=1447624008&server=video44";

$headers = get_headers($url);

$code = $headers[0];
?>

Original Referrer

http://gateway.play44.net:3010/old/videos/one-punch_man_-_03.mp4?st=xV6C9jBU17ALqrMSAWriLA&e=1447624008&server=video44

Landing Page of the original referrer (I want to pull this on out using the original referrer)

http://s3.videobug.net/O/one-punch_man_-_03.mp4?st=k99nV8wxJ8nuqiDVWzFMqg&e=1447624008&start=0

  • For me it redirects to http://s7.videobug.net/O/one-punch_man_-_03.mp4?st=k99nV8wxJ8nuqiDVWzFMqg&e=1447624008&start=0 – nickdbush Nov 15 '15 at 20:02
  • It changes, I only want to get the landing page url – Musang Sang Nov 15 '15 at 20:09
  • Do you have access to the server administration? If you don't surely there's nothing that you can do as it the redirect is done from the server side (by opening DevTools we can see that the server is sending a 302 "Temporarily Moved" response which can't be ignored by your browser). – nickdbush Nov 15 '15 at 20:15
  • I have updated my question above to make it more clear to you – Musang Sang Nov 15 '15 at 20:22
  • You may be looking for this: http://stackoverflow.com/questions/3799134/how-to-get-final-url-after-following-http-redirections-in-pure-php – nickdbush Nov 15 '15 at 20:25
  • I love you! This one works great! – Musang Sang Nov 15 '15 at 20:27

0 Answers0