title: Apache .htaccess image exists check and redirect
body: <p>I have a website with file directory like this</p>
  
  <pre><code>/index.php (home page)
  
  /storage (file storage directory)
      /800 (800 pixel width dir)
          /800x200.png
          /800x350.png
          ....
      /200 (200 pixel width dir)
          /200x150.png
          /200x185.png
          ...
      ....
  
  /css
      /style.css
  
  /images
      /logo.png
  
  /jscript
      /autoload.js
  </code></pre>
  
  <p>Now user will make a request <code>http://example.com/images/200x150</code> or <code>http://example.com/images/200x180</code>. From two URL we know that first image is existed in <code>/storage/200/200x150.png</code> but not second one.</p>
  
  <p>So, I want to write <code>.htaccess</code> for this (theoretically here).</p>
  
  <pre><code>Rewrite Condition /storage/{width}/{widthxheight}.png existed?
  Rewrite Rule {output the image}
  Rewrite Failed {go to /somedir/failed.php}
  </code></pre>
  
  <p>How can I do this?</p>