title: Redirecting all requests to index.php with exceptions
body: <p>I've searched everywhere trying to find a solution to something I thought was a particularly common problem, but I can't seem to find anything that works.</p>
  
  <p>I'm using mod_rewrite to redirect all requests via my own CMS (index.php). Here's the htaccess code:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteBase /blog/
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
  &lt;/IfModule&gt;
  </code></pre>
  
  <p><em>(The above mod_rewrite is exactly the same as the code found in a standard Wordpress installation which is why I'm perplexed as to how I cannot find a solution for the following problem)</em></p>
  
  <p>I want to add some image processing to my video thumbnails. I have written a php script (video-image.php) that works great but I cannot seem to find a means to redirect the images urls whilst keeping the index.php redirect intact. The code I'm looking for does something like this:</p>
  
  <pre><code>RewriteRule ^images/video/(.*)/(.*).jpg /images/video/video-image.php?video_image_id=$2&amp;video_image_width=$1 [NC]
  </code></pre>
  
  <p>But the above code seems to clash with the mod_rewrite that sends my requests to index.php. It seems I can either redirect the images to video-image.php or redirect my pages to index.php but there must be a way to do both?</p>
  
  <p>I've always found mod_rewrite confusing so apologies if I'm not explaining myself clearly enough. All php scripts function perfectly well without the mod_rewrite so I'm certain it's not a php issue.</p>
  
  <p>If anyone can shed any light on this problem or point me to an answer I'd really appreciate it!</p>