title: .htaccess ignoring RewriteCond
body: <p>I have the following directory structure for a site we're currently working on:</p>
  
  <pre><code>root
     - admin/
     - assets/
     - cache/
     - images/
     - .htaccess
     - category.php
     - image.php
     - resize.php
  </code></pre>
  
  <p>I would like to rewrite the URLs according to a number of conditions, and have achieved this using <code>.htaccess</code>. For some reason, Apache seems to be completely ignoring the <code>RewriteCond</code> rules I have added. Here's a copy of the <code>.htaccess</code> file:</p>
  
  <pre><code>DirectoryIndex index.php category.php
  Options +FollowSymLinks 
  
  RewriteEngine On
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  
  # Image rewrites:
  RewriteRule ^([^/]+)/([0-9]+)/(.*)$ resize.php?function=resizeRatio&amp;width=$2&amp;src=images/$1/$3 [L]
  RewriteRule ^([^/]+)/([^/]+)([0-9]+)/(.*)$ resize.php?function=resizeRatio&amp;width=$3&amp;src=images/$1/$2/$4 [L]
  RewriteRule ^([^/]+)/([0-9]+)x([0-9]+)/(.*)$ resize.php?function=resizeCrop&amp;width=$2&amp;height=$3&amp;src=images/$1/$4 [L]
  RewriteRule ^([^/]+)/([^/]+)([0-9]+)x([0-9]+)/(.*)$ resize.php?function=resizeCrop&amp;width=$3&amp;height=$4&amp;src=images/$1/$2/$5 [L]
  
  # Category rewrites:
  RewriteRule ^([^/]+)/$ category.php?parent=$1 [L]
  RewriteRule ^([^/]+)/([^/]+)/$ category.php?parent=$1&amp;child=$2 [L]
  
  RewriteRule ^([^/]+)/([^/]+).(.*)$ image.php?image=$2.$3&amp;parent=$1 [L]
  RewriteRule ^([^/]+)/([^/]+)/([^/]+).(.*)$ image.php?image=$3.$4&amp;parent=$1&amp;child=$2 [L]
  </code></pre>
  
  <p>When attempting to visit <code>/admin/</code>, I am directed to the rewritten page of <code>category.php?category=admin/</code>.</p>
  
  <p>Why is Apache behaving in this manner, and how can I resolve it?</p>