RewriteRule for only .php files
<p>I need to rewrite this url:</p>

<pre><code>mysyte.com/index.php?lang=it
</code></pre>

<p>to:</p>

<pre><code>mysite.com/it/index
</code></pre>

<p>without rewriting css href, javascript src and image src.
I tried many solutions but none worked, could someone help me?</p>

<p>thanks!</p>

<p>edit:</p>

<p>I tried:</p>

<pre><code>RewriteEngine On
RewriteRule ^(.*)/(.*) $2.php?lang=$1
</code></pre>

<p>but this overwrites my css calls too.</p>

<p>then I tried:</p>

<pre><code>RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)/(.*) $2.php?lang=$1
</code></pre>

<p>with the same result</p>