I am trying to remove the index.php in the url for Code Igniter. According to the official guide, I should add the following code to the .htaccess file.
RewriteE
Make this changes to config file
$config['base_url'] = 'http://localhost/projectname/';
$config['index_page'] = '';
Then in ur .htaccess try
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|(.*)\.swf|forums|images|css|downloads|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?$1 [L,QSA]
Also make sure that you have mod_rewrite
enabled in your apache configuration
The .htaccess file should be in root directory of your project, ie outside application folder