title: Absolute path to subfolder
body: <p>I have apache setup to serve sites in <code>/var/www</code>, and I have many sites in this directory. Now I don't own any of these sites and cannot update any of their content.</p>
  
  <p>The problem is most of these websites use absolute path for their assets like <code>&lt;img src="/img/foo.png"&gt;</code>, and apache tries to load them from <code>/var/www/</code> instead of say <code>/var/www/example1/</code>.</p>
  
  <p>I tried to add a <code>.htaccess</code> to <code>/var/www/</code> to rewrite every paths to assets to a subdirectory, but I can't find a way to make assets from <code>/var/www/example1/</code> loaded from this directory and assets from <code>var/www/example2/</code> loaded from <code>example2</code> instead of <code>example1</code>.</p>
  
  <p>Is there a way to make this work? I don't really like the <code>.htaccess</code> solution in <code>/var/www/</code>, at first I wanted to use a vHost configuration for every sites but I didn't find how to do it (at least without having a domain name for each site).</p>
  
  <p>Thanks!</p>