If your CodeIgniter project is mounted on URL that looks like


and you want to remove the index.php so that your URL to a some page example a blog page will look like this


instead of


Then first you need to make sure that mod_rewrite is enabled in your apache by typing this in the terminal:

sudo a2enmod rewrite
sudo service apache2 restart

Then in your CodeIgniter installation folder add an .htaccess containing this:

 RewriteEngine on
 RewriteCond $1 !^(index\.php|resources|robots\.txt)
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^(.*)$ index.php/$1 [L,QSA]

The last thing you need to do is make sure that in your config.php index_page is blank:

 $config[index_page] = ;