title: URL Rewrite: Prevent rewrite entirely on exising resource
body: <p>The .htaccess file below in my root directory serves to rewrite all /api/ then outputs the key value pairs from the URL from the $_GET inside /api/api.php?</p>
  
  <p>How do I modify this so that all existing files or folders inside api (such as /api/test or /api/test/file.php accessed via this scheme will not rewrite via the rewrite rule?</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt; 
      Options +FollowSymlinks
      RewriteEngine On
      RewriteCond %{REQUEST_URI} ^/api
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      #RewriteRule (.*) $1
      RewriteCond %{QUERY_STRING} ^(.*)$
      RewriteRule ^(.*/)([^/]+)/([^/]+) $1?$2=$3&amp;%1 [QSA,L]
      RewriteCond %{REQUEST_URI} ^/api
      RewriteCond %{QUERY_STRING} ^(.*)$
      RewriteRule ^([^/]+)/ $1/$1.php?%1 [L]
  &lt;/IfModule&gt;
  </code></pre>