Easy Steps To Remove index.php from your CodeIgniter Web Application

Easy Steps To Remove index.php from your CodeIgniter Web Application

First thing you have to do is changing the config settings on the config.php file located in Application/config folder.

1. Go to config.php located in application/config path

2. search $config[‘index_page’] and remove it’s value.


$config['index_page'] = "index.php" // Remove index.php
$config['index_page'] = ""

Now You have to create new file calls “.htaccess” in our web app folder.

Example if our web application name “student_cms”, under that directory we have create this .htaccess file.

Then we can paste following code to it.


RewriteEngine on
RewriteBase /student_cms/
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1

Under localhost or sub directory of the domain, “RewriteBase” you can set your project path. otherwise you don’t need to have the name of the directory.

If you have any other issue please comment below.

Be the first to comment

Leave a Reply

Your email address will not be published.


*