How to remove "index.php" in codeigniter's path

OrangeRind picture OrangeRind · Sep 18, 2009 · Viewed 122.7k times · Source

How do I remove the "index.php" sticking out in every path in codeigniter somewhere in the center? I want clean non index.php-fied URLs?

Answer

Sean Vieira picture Sean Vieira · Sep 18, 2009

If you are using Apache place a .htaccess file in your root web directory containing the following:

RewriteEngine on
RewriteCond $1 !^(index\.php|[Javascript / CSS / Image root Folder name(s)]|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

Another good version is located here:

http://snipplr.com/view/5966/codeigniter-htaccess/