title: .htaccess RewriteCond for existing and non-existing files
body: <p>I am trying to <strong>use .htaccess to redirect all url requests of a certain subpath ("URL/somefolders/main/..") to one basefile</strong> named "_index.php". So I implemented the following .htaccess to the "folder" <em>URL/somefolders/main/</em> : </p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  DirectoryIndex index.php
  RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^([^?]*)$ /main/_index.php?oldpath=$1 [NC,L,QSA]
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>The redirection <strong>works fine for all non-existant files</strong>, but if the file <strong>exists then it is called without redirection</strong>. I suppose this is because I ordered to do so by the "!" in the RewriteCond, but all my tries to change it failed. </p>
  
  <p><strong>How do I have to change the above code to redirect all files (existant or not) ?</strong></p>
  
  <p><strong>Edit:</strong></p>
  
  <p>All my tries still end up uneffective or erroneous.
  The latter with the Apache log error:</p>
  
  <p><code>Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.</code></p>
  
  <p>Currently I fear that in fact I did correctly allow non-existant files in most of my before tries but get me a problem with an endless loop due to included files - is this possible? And if so can the .htaccess distinguish between "internal" and "external" file requests?</p>