title: .htaccess rewrite rule rewriting 301 redirects
body: <p>I have a problem with my .htaccess redirects. I have both a rewrite rule to remove the "index.php?/" from my URLs (I'm using a PHP framework), and also 301 redirects redirecting from old pages: </p>
  
  <pre><code># START THE REWRITE
  RewriteEngine on
  Options -Indexes
  Options +FollowSymLinks
  RewriteCond $1 !^(index\.php|assets)
  RewriteRule ^(.*)$ /index.php?/$1 [L]
  
  # 301 REDIRECTS
  Redirect 301 /oldpage.html http://www.example.com/old_page
  Redirect 301 /page.html http://www.example.com/page
  Redirect 301 /page-that-no-longer-exists.html http://www.example.com/
  </code></pre>
  
  <p>I can't rename my .html files with another rewrite rule as some of the pages don't match the new pages, and some other .html pages are redirecting to the home page - hence the 301 redirects.</p>
  
  <p>And so, because of the rewrite rule, the first 301 redirect will direct to</p>
  
  <p><a href="http://www.example.com/old_page?/old_page.html" rel="nofollow">http://www.example.com/old_page?/old_page.html</a></p>
  
  <p>instead of</p>
  
  <p><a href="http://www.example.com/old_page" rel="nofollow">http://www.example.com/old_page</a></p>
  
  <p>I have tried reordering the contents of the .htaccess file (which does nothing), setting the rewrite to "off" after the rewrite (which stops the 301's working) and writing specific rewrite rules for each 301 (none of which worked).</p>
  
  <p>I'm sure i'm missing something. Cheers.</p>