title: How to rewrite the images path according to the written rules of the url?
body: <p>I am trying to rewrite the url of an application with parameters.<br />
  I have a link in the main file <code>main.php</code>.</p>
  <pre><code>&lt;a href=&quot;index?id=100&amp;title=sub-url-here&gt;Continue&lt;/a&gt;
  </code></pre>
  <p>In the <code>index.php</code> file, there is an image tag with the src pointing to <code>ìmages/</code> folder.</p>
  <pre><code>&lt;img src=&quot;images/fileaname.png&quot; /&gt;
  </code></pre>
  <p>All this works just fine.</p>
  <p>The problem occurs after writing the URL.<br />
  This is what I have in the <code>.htaccess</code> file</p>
  <pre><code>RewriteEngine O
  
  RewriteRule ^index/([0-9]+)/([0-9a-zA-Z-_]+)/?$ index.php?id=$1&amp;title=$2 [NC,L]
  </code></pre>
  <p>I now have in the <code>index.php</code> file:</p>
  <pre><code>&lt;a href=&quot;index/100/sub-url-here/&quot;&gt;Continue&lt;/a&gt;
  
  </code></pre>
  <p>However, the image path in the <code>main.php</code> file is now pointing to</p>
  <pre><code>&lt;img src=&quot;100/sub-url-here/images/fileaname.png&quot; /&gt;
  </code></pre>
  <p>How can I rewrite the image path according to the written url in the <code>.htaccess</code> ?</p>