Remove index.php file from codeigniter URL

In this post I will show you how to Remove index.php file from codeigniter URL.By default the index.php file are including in the url.How to remove the index.php file from the url you need to do some simple things.
First create the .htaccess file in the codegniter root.
simply copy and paste the below code in the .htacces file.

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

Now open the application folder and open the config folder.Remove index.php file.
You will see a file config.php. Open the file and remove the index.php
in front of $config[‘index_page’]

Replace:

$config['index_page'] = "index.php"
to
$config['index_page'] = ""

 if it still not work try to replace:
 
 $config['uri_protocol'] = "AUTO"
//replace with the below code
$config['uri_protocol'] = "REQUEST_URI"




Hope this article will help you to Remove index.php file from codeigniter URL.Keep reading and support w3code.in.