title: If existing file, redirect to a certain file, else redirect to 404 from htaccess
body: <p>I have this tree:</p>
  
  <pre><code>libs/
  html/
  app/
  uploads/
      files/
      images/
          male.png
          female.png
      .htaccess
      download.php
  .htaccess
  index.php
  </code></pre>
  
  <p>/.htaccess has this content:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
      &lt;IfModule mod_negotiation.c&gt;
          Options -Indexes
      &lt;/IfModule&gt;
  
      RewriteEngine On
  
      RewriteRule ^ index.php [END,L]
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>I want /uploads/.htaccess to:</p>
  
  <ul>
  <li><p>redirect to download.php</p>
  
  <ul>
  <li>if existent file, but not this .htaccess or download.php</li>
  </ul></li>
  <li><p>redirect 404</p>
  
  <ul>
  <li>if don't match existent file</li>
  <li>or match .htaccess or download.php</li>
  <li>or match existent folder</li>
  </ul></li>
  </ul>
  
  <p>Examples:</p>
  
  <pre><code>www.example.com/uploads - redirect 404
  www.example.com/uploads/files - redirect 404
  www.example.com/uploads/images- redirect 404
  www.example.com/uploads/.htaccess - redirect 404
  www.example.com/uploads/download.php - redirect 404
  www.example.com/uploads/nonexistentfile - redirect 404
  
  www.example.com/uploads/images/male.php - redirect download.php
  www.example.com/uploads/images/female.php - redirect download.php
  </code></pre>