title: Rewriting problem with .htaccess (removing /index.php from CodeIgniter URLs)
body: <p>I have a small issue with some .htaccess rules on our website - <a href="http://www.presencemultimedia.co.uk" rel="nofollow">http://www.presencemultimedia.co.uk</a></p>
  
  <p>We've recently re-built the website using CodeIgniter. To use nice URLs I've added some lines to our .htaccess file as below :</p>
  
  <pre><code>RewriteEngine on
  
  # CodeIgniter rules (forwards requests to index.php)
  RewriteCond $1 !^(index\.php|images|robots\.txt|public)
  RewriteRule ^(.*)$ /index.php/$1 [L]
  
  # rewrites path to our primary domain (www.presencemultimedia.co.uk)
  RewriteCond %{http_host} !www.presencemultimedia.co.uk$
  RewriteRule ^(.*)$ http://www.presencemultimedia.co.uk/$1 [r=301,nc]
  </code></pre>
  
  <p>The second rewrite rule is designed to ensure the domain is always our primary domain (www.presencemultimedia.co.uk).</p>
  
  <p>The issue I have is that if the website is accessed by an aliased domain, e.g. <a href="http://www.prmulti.com" rel="nofollow">http://www.prmulti.com</a>, the URL is rewritten to the primary domain but adds /index.php/ to the path.</p>
  
  <p>For example - <a href="http://www.prmulti.com/about/" rel="nofollow">http://www.prmulti.com/about/</a> should rewrite to <a href="http://www.presencemultimedia.co.uk/about/" rel="nofollow">http://www.presencemultimedia.co.uk/about/</a> instead of <a href="http://www.presencemultimedia.co.uk/index.php/about" rel="nofollow">http://www.presencemultimedia.co.uk/index.php/about</a></p>
  
  <p>Can anyone see where I'm going wrong?</p>
  
  <p>Cheers, Phil</p>