Example: I give file_get_contents('http://youtube.com')
and then, if the src
and href
of the html do not have the entire path, but only src="/pasta/arquivo.ext"
, instead of src="https://youtube.com/pasta/arquivo.ext"
, the requests will give all 404 not found
, because it will fetch on my server (localhost).
Is there any parameter of header http
that I can change to indicate where I want those requests to go? I tried to rewrite and put the entire path in the references, by means of str_replace()
, but no use, because the javascript files make request for the localhost and it disrupts the operation in the same way. You can not download everything and rewrite; I wanted to change this in the http header (I think it's possible)
YouTube was just the example level. I do not want to copy the site but to make modifications in the css of the embed player. (I do not want libs, I'm doing this as an exercise)
Thank you all.