0

I use file_get_contents to get the content of a webpage,

$urlContent = file_get_contents('http://some.tld');

this webpage redirects to another page.

<meta http-equiv="refresh" content="0;url=http://some.tld/123">

What I need is the URL it is directing to. Here it would be http://some.tld/123

It seems file_get_contents is waiting to be redirected and gets the content of the new site.

  • If you can use cURL instead, then you can [check this post out](https://stackoverflow.com/a/3520085/2453432) for an example. – M. Eriksson Mar 21 '19 at 06:45
  • Possible duplicate of [How can I find where I will be redirected using cURL?](https://stackoverflow.com/questions/3519939/how-can-i-find-where-i-will-be-redirected-using-curl) – Roy Bogado Mar 21 '19 at 07:05

0 Answers0