title: Magento - urls with index.php do not redirect
body: <p>This is a slight variation on the standard 'how to remove index.php from magento url' question.</p>
  
  <p>I've implemented the changes mentioned in <a href="https://stackoverflow.com/questions/10474740/how-to-remove-index-php-from-urls?lq=1">this answer</a> and the urls generated on the site no longer show the index.php.</p>
  
  <p>However, taking it a step further, old links to the site with index.php still in the url are still valid.</p>
  
  <p>e.g. www.mydomain.com/index.php/page1 is mentioned somewhere online and user follows the link to the site.  Instead of redirecting to www.mydomain.com/page1 it remains as it was and is still picked up in our analytics as a separate url.</p>
  
  <p>I'm not familiar with the LAMP environment (still on the learning curve!), so I'm not used to mod_rewrite rules. Any help you can offer in educating me on how to structure the rule so that it strips the index.php from the url and 301 redirects to the remainder would be appreciated!</p>
  
  <p>thanks!</p>