htaccess RewriteRule problems
<p>I have a web page which works fine on live server. However some links to files (jpg, pdf and others) which are created with cms editor contain relative paths.
When I run that page on my local test server which serves the pages out of a sub folder of localhost the relative paths to the files are wrong since they are missing the subfolder at the beginning. The html page loads fine. It's just some files in it that have wrong path and won't load.</p>

<p>page loads from <a href="http://localhost/level1/" rel="nofollow">http://localhost/level1/</a></p>

<p>files are trying to load from <a href="http://localhost/level2/" rel="nofollow">http://localhost/level2/</a> and I get 404s.</p>

<p>They should be loading from <a href="http://localhost/level1/level2/" rel="nofollow">http://localhost/level1/level2/</a></p>

<p>So I setup a RewriteRule to correct the path but no matter what I have tried I can't get it to work. I have tried various flags including [R,L] but nothing changes the URI in the html.</p>

<p>currently I have:</p>

<pre><code>RewriteRule ^/level2/(.*)$ /level1/level2/$1 [R]
</code></pre>

<p>Any suggestions?</p>

<p>Thanks</p>