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

To remove "index.php" from the URL in CodeIgniter, you can use the .htaccess file. Here's an example of how to do it:

  1. Create a .htaccess file in the root of your CodeIgniter installation.

  2. Add the following code to the .htaccess file:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
  1. Make sure that the mod_rewrite module is enabled on your server. If not, contact your hosting provider to enable it.

Watch a course Learn object oriented PHP

  1. Open the application/config/config.php file and set the $config['index_page'] variable to an empty string:
$config['index_page'] = '';

Now, the "index.php" should be removed from your URLs and your CodeIgniter application should work as expected.

Note: This process may vary depending on your hosting provider and server configuration.