title: Relative urls in a proxied website don't work
body: <p>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).</p>
  
  <p>That proxied output often has lots of assets with relative URLS and actually inheret the hostname of my site, not the proxied site:</p>
  
  <p>example:
  [http://<strong>MYSITE</strong>.com/proxy?url=http://somesite.com] would return the html of [http://<strong>somesite</strong>.com]</p>
  
  <p>in the response html, there is stuff like this:</p>
  
  <pre><code>&lt;link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png"&gt;
  </code></pre>
  
  <p><strong>The problem:</strong></p>
  
  <p>Instead of the asset looking for that asset at <code>http://somesite.com/assets/ico/apple-touch-icon-144-precomposed.png</code>, it actually tries to find it at <code>http://MYSITE.com/assets/ico/apple-touch-icon-144-precomposed.png</code> which is wrong.</p>
  
  <p><strong>The Question</strong>:</p>
  
  <p>What do i need to do to get their relative-path assets to load properly via the proxy?</p>