title: mod_rewrite apache for custom flat links gets stuck
body: <p>I want to create flat links for my website. The <code>.htaccess</code> code is following:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
      RewriteEngine On
      RewriteBase /
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^([0-9A-Za-z]+)?$ /index.php?page=$1 [L]
      RewriteRule ^([0-9A-Za-z]+)/?$ /index.php?page=$1 [L]
  &lt;/IfModule&gt;`
  </code></pre>
  
  <p>Now my website is working which can be seen through <code>print_r($_GET)</code> and getting all the values.</p>
  
  <p>My website has a code like this: <code>&lt;img src="images/icons/image.png" /&gt;</code>, where the image resides on path: <code>/images/icons/up.png</code>.</p>
  
  <p>Now I can visit my website as: <code>http://somedomain.com/home</code> and everything works fine. But when I put: <code>http://somedomain.com/home/</code>, it gets stuck.</p>
  
  <p>The image gets a path like this for the browser: <code>http://somedomain.com/home/images/icons/image.png</code> which is not available and it should be: <code>http://somedomain.com/images/icons/image.png</code>.</p>
  
  <p>How to solve this?</p>
  
  <p>It would helpful if there is any solution by modifying the <b>.htaccess</b> as I want to use relative paths for all links and not full path.</p>
  
  <hr>
  
  <p>Thanks to Ben Clifford for your help. According to him if I redirect the second rule one to the format like the first one and not over index.php. Then it should work.</p>