Removing index.php from url of CodeIgnitor project | Using .htaccess file

Step 1 : Edit the configuration file to give the permission to override default settings.
command: sudo nano /etc/apache2/sites-available/default
Change the value of AllowOverride to ‘All’ from ‘none’

sample:

Step 2: Enable module rewrite
command: sudo a2enmod rewrite

Step 3: Restart apache server
command: sudo service apache2 restart

sample .htaccess:

N.B: Don’t forget to press Enter once at the end of the htaccess file.Because Newline represents the end of file.

SELF NOTE