title: How does mod_rewrite validate whether the request is a file or directory?
body: <p>Given the conditions and rule below,how does mod_rewrite validate whether the request is a file or directory?</p>
  
  <pre><code>  RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
  </code></pre>
  
  <p>My interpretation is that if the request is not a file <strong>AND</strong> not a directory then process the rewrite rule which has the pattern any character that is not a question mark, substitute as a querystring with the back-reference <code>$1</code></p>
  
  <p>Isn't every request a file or directory e.g. index.php, style.css, media, etc? Shouldn't the condition be </p>
  
  <pre><code>    RewriteCond %{REQUEST_FILENAME} -f [OR]
      RewriteCond %{REQUEST_FILENAME} -d
      RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
  </code></pre>
  
  <p>Which would read that if the request is a file <strong>OR</strong> a directory then process the rewrite rule</p>