title: Why is mod_rewrite adding var/www/html to the resulting url
body: <p>I am trying to make my service backward compatible, since I have moved the service to a new path internaly, I still want the users to access it with the old url as not all of them have knowledge of this change.</p>
  
  <p>I can accomplish what I want if I add [R] flag at the end of  my rewrite rule but it redirects the url on the client side, which I don't want.</p>
  
  <p>My rewrite code:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
    RewriteEngine On
    RewriteRule ^/old-path(.*)$ /new-path/$ [L]
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>Although this rule results in the following url:</p>
  
  <blockquote>
    <p>/var/www/html/new-path</p>
  </blockquote>
  
  <p>Sample request looks something like:</p>
  
  <blockquote>
    <p><a href="https://host-name/old-path/param1/param2/param3/param4" rel="nofollow noreferrer">https://host-name/old-path/param1/param2/param3/param4</a></p>
  </blockquote>
  
  <p>and rewrite rule should just replace old-path with the new-path.</p>
  
  <p>Can anyone give me some clues about what am I doing wrong? and how can I fix it?</p>
  
  <p>Thanks in advance!</p>