title: URL rewriting: conflicting rewrite rules
body: <p>I'm trying to do three things with my URL rewriting:</p>
  
  <ol>
  <li>remove .php file extensions</li>
  <li>have my post URLs look like this: mydomain.co.uk/resources/example-post The default is mydomain.co.uk/resources/post.php?s=example-post</li>
  <li>have my category archive URLS look like this: mydomain.co.uk/resources/category/example-category The default is mydomain.co.uk/resources/archive.php?cat=example-category</li>
  </ol>
  
  <p>This is what I have in my .htaccess file at the moment:</p>
  
  <pre><code>RewriteEngine On
  RewriteBase /
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME}.php -f
  RewriteRule ^([^\.]+)$ $1.php [L,QSA]
  
  RewriteRule ^resources/([a-zA-Z0-9-/]+)$ /resources/post.php?s=$1 [L]
  
  RewriteRule ^resources/category/([a-zA-Z0-9-/]+)/page/([0-9]+)/{0,1}$ /resources/archive.php?cat=$1&amp;page=$2 [L]
  RewriteRule ^resources/category/([a-zA-Z0-9-/]+)$ /resources/archive.php?cat=$1 [L]
  </code></pre>
  
  <p>It's doing the first two things. But not the third.</p>
  
  <p>If I remove</p>
  
  <pre><code>RewriteRule ^([^\.]+)$ $1.php [L,QSA]
  </code></pre>
  
  <p>Then it does the third things, but not the first two.</p>
  
  <p>Any ideas what's going? How do I get it do all three things at once?</p>