title: Redirecting all requests to index.php except /files subdirectory
body: <p>I have very little understanding of .htaccess files so far. I want to redirect all requests to one index.php file in my root folder, except if the url links to a file that exists and is in the files folder. (e.g. example.com/files/picture.png) I want to achieve this with only htaccess file in the root directory and if necessary one in the files directory. Moreover, i don'd want to show a permission denied message.</p>
  
  <p>Right now i have this:</p>
  
  <pre><code>RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule . index.php [L]
  </code></pre>
  
  <p>But it does not redirect one to the index.php file if the file the url refers to exists. Any help? I sought on the internet but could not find anything.</p>