title: multiple complex .htaccess RewriteRules
body: <p>I need help setting up the <code>RewriteRules</code> in my <code>.htaccess</code> file. I need to first check for any existing files, then some custom rewrites, and if any of those doesn'y match rewrite it to <code>index.php</code>.</p>
  <p>My current <code>.htaccess</code>, located in the document root, file looks like this:</p>
  <pre><code>RewriteEngine On
  
  RewriteBase /
  
  # Don't rewrite existing files
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-l
  
  # Custom rewrites
  # TODO: Don't know how to make these work
  # RewriteRule ^/css/style\.css$  /css/style.css.php [L,NC,QSA]
  # RewriteRule ^/js/config\.js$   /js/config.js.php [L,NC,QSA]
  # RewriteRule ^/js/post\.js$     /js/post.js.php [L,NC,QSA]
  
  # If any of the above don't match hand it to index.php
  RewriteRule ^(.+)$ index.php [QSA,L]
  
  php_value upload_max_filesize 10485760
  php_value post_max_size 10485760
  </code></pre>
  <p>Thanks in advance!</p>