how to remove index.php in codeigniter 3 route

Remove index.php in CodeIgniter 3 Route

1. Open the config.php file located in application/config directory.
2. Find the $config['index_page'] variable and set it to an empty string: $config['index_page'] = '';
3. Create or modify the .htaccess file in the root directory of your CodeIgniter installation with the following content:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ /index.php/$1 [L]