title: RewriteCond strange behavior (file exists check)
body: <p>I can't understand why redirect depends on RewriteRule (not on RewriteCond).</p>
  
  <p>My .htaccess:</p>
  
  <pre><code>Options +FollowSymLinks +SymLinksIfOwnerMatch
  
  &lt;IfModule mod_rewrite.c&gt;
  RewriteEngine on
  
  RewriteCond %{REQUEST_FILENAME} -f
  RewriteRule ^(.*)$ true.txt
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ false.txt
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>Root folder contains:</p>
  
  <blockquote>
    <p>true.txt (contains 'true')<br>
    false.txt (contains 'false')<br>
    test.txt (contains 'test')</p>
  </blockquote>
  
  <p>If I try to open <code>test.txt</code> I get <code>true</code> and if I try to open <code>nonexist.txt</code> i get <code>true</code> too.</p>
  
  <p>Now I change my .htaccess:</p>
  
  <pre><code>...
  RewriteCond %{REQUEST_FILENAME} -f
  RewriteRule ^(.*)$ $1
  ...
  </code></pre>
  
  <p>And now if I try to open <code>test.txt</code> I get <code>test</code> and if I try to open <code>nonexist.txt</code> i get <code>false</code>.</p>
  
  <p><strong>UPDATE</strong>: Thanks for answers, I understood how it works but one problem still exists.
  If I try to check 'if file exists' in another directory it always returns <code>false</code>.</p>
  
  <blockquote>
    <p><code>/files/test.txt</code> <br>
    <code>/script/.htaccess</code> <br>
    <code>/script/false.txt</code> <br>
    <code>/script/true.txt</code> <br></p>
  </blockquote>
  
  <p>now my .htaccess looks like</p>
  
  <pre><code>RewriteCond %{REQUEST_FILENAME} .*(true|false).*$
  RewriteRule .* - [S=2]
  
  RewriteCond %{DOCUMENT_ROOT}/files/%{REQUEST_FILENAME} -f
  RewriteRule ^(.*)$ true.txt [L]
  
  RewriteCond %{DOCUMENT_ROOT}/files/%{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ false.txt [L]
  </code></pre>
  
  <p>I always get <code>false</code>. 
  I also tried <code>RewriteCond ../files/%{REQUEST_FILENAME}</code> and also always get <code>false</code> result.</p>
  
  <p>If I move <code>test.txt</code> in <code>script</code> folder then and change <code>RewriteCond %{REQUEST_FILENAME}</code> all works fine. </p>