title: Redirect index.php in CodeIgniter
body: <p>I created a CodeIgniter application and now I'm trying to redirect the urls with index.php to urls without it.</p>
  
  <p>My current .htaccess is:</p>
  
  <pre><code>RewriteEngine On
  RewriteBase /
  
  # Removes trailing slashes (prevents SEO duplicate content issues)
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.+)/$ $1 [L,R=301]
  
  # Enforce www
  # If you have subdomains, you can add them to 
  # the list using the "|" (OR) regex operator
  RewriteCond %{HTTP_HOST} !^(www|subdomain) [NC]
  RewriteRule ^(.*)$ http://www.plugb.com/$1 [L,R=301]
  
  # Checks to see if the user is attempting to access a valid file,
  # such as an image or css document, if this isn't true it sends the
  # request to index.php
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php/$1 [L]
  </code></pre>
  
  <p>The only problem is that the same page is accessible with and without the index.php.</p>
  
  <p>For example:</p>
  
  <p><a href="http://www.plugb.com/index.php/games/adventure-rpg" rel="nofollow noreferrer">http://www.plugb.com/index.php/games/adventure-rpg</a></p>
  
  <p>and</p>
  
  <p><a href="http://www.plugb.com/games/adventure-rpg" rel="nofollow noreferrer">http://www.plugb.com/games/adventure-rpg</a></p>
  
  <p>Is there a way to redirect the index.php URLs?</p>
  
  <p>Thank you,
  Gabriel.</p>