in PHP, I've written a proxy function that accepts a url, user agent, and other settings. Then the function makes a curl request for the website, and prints out that output with proper html content type headers into an iframe (this is necessary only because of my need to change some headers).
That proxied output often has lots of assets with relative URLS and actually inheret the hostname of my site, not the proxied site:
example: [http://MYSITE.com/proxy?url=http://somesite.com] would return the html of [http://somesite.com]
in the response html, there is stuff like this:
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png">
The problem:
Instead of the asset looking for that asset at http://somesite.com/assets/ico/apple-touch-icon-144-precomposed.png
, it actually tries to find it at http://MYSITE.com/assets/ico/apple-touch-icon-144-precomposed.png
which is wrong.
The Question:
What do i need to do to get their relative-path assets to load properly via the proxy?