How to removed index.php from url in CodeIgniter ?

If you want to remove index.php from url then you must follow these steps.

Check the apache httpd.conf file where you have to check rewrite_module is enabled or not. Just find the rewrite_module and check if it is commented or not, if it is preceded by # character then you must removed it.
Add .htaccess file with below code to your root folder.

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

Removed index.php from application/config/config.php file.

<<?php   $config['index_page'] = 'index.php'; 
//Replace with 
$config['index_page'] = ''; 
Please follow and like us:

Leave a Reply

Your email address will not be published. Required fields are marked *