title: Reroute to index with working images
body: <p>I'm working on a site where i want to route all communications trough the index file. I have a simple test project with the following architecture:</p>
  
  <pre><code>root-   
     -.htaccess   
     -index.php   
     -icon.jpg
  </code></pre>
  
  <p>My .htacces is as follows:</p>
  
  <pre><code>RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d  
  RewriteRule ^(.*)$ index.php/$1 [L]
  </code></pre>
  
  <p>this works, now can visit www.mysite.com/abc/def/ghi and still the index.php page shows.</p>
  
  <p>I can use abc/def/ghi by retrieving the $_SERVER[ 'REQUEST_URI' ].</p>
  
  <p>However, lets say i this in my index.php:</p>
  
  <pre><code>echo "&lt;img src='icon.jpg'&gt;";    
  </code></pre>
  
  <p>the icon will not show up because the server will search for it in: </p>
  
  <pre><code>www.mysite.com/abc/def/ghi/icon.jpg
  </code></pre>
  
  <p>instead of </p>
  
  <pre><code>www.mysite.com/icon.jpg
  </code></pre>
  
  <p>What am i doing wrong, and how would one solve this problem professionaly? </p>