title: how to write mod_rewrite rules just for php files
body: <p>I'm trying to write a rule for a directory of my site.</p>
  
  <p>I tried something like this:</p>
  
  <pre><code>RewriteEngine on
  
  RewriteRule ^(css|font|img|js)/([a-zA-Z0-9\/\.])$ $1/$2 [L]
  
  RewriteRule ^([a-zA-Z0-9\/\_]*)$ index.php?url=$1 [L]
  </code></pre>
  
  <p>but I cant understand why it is not working well.</p>
  
  <p>1- I want users have direct access to these directories <code>css|font|img|js</code> 
  (just for files, not directory lists. rewrite directory list to <code>403.php</code>)</p>
  
  <p>2- I want users have direct access to <code>*.js|*.css</code> files in view directory.
  (not other file. rewrite other to <code>403.php</code>)</p>
  
  <p>3- I want to rewrite every other urls to <code>index.php?url=$1</code></p>
  
  <p>thanks in advance.</p>