By default, URL in are designed to be search-engine and human friendly. Rather than using the standard query string approach to URL that is synonymous with dynamic systems, CodeIgniter uses a segment-based approach:

example.com/class_name/function_name/id

Removing the index.php file in codeigniter

By default, the CodeIgniter index.php file will be included in your URL:

example.com/class_name/function_name/id

If your Apache server has mod_rewrite enabled, you can easy remove this file by using a .htaccess file with some simple rules. Here is an example of such a CodeIgniter file using the negative method in which everything is redirected except the specified items:

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

.htaccess file create in your project root directory.