How to remove index.php from URL in codeigniter [SOLVED]

In this tutorial you will learn how to remove index.php from URL CodeIgniter. we will use .htaccess file to solve this issue. htaccess is configuration file that controls the directory “.htaccess”. It is used to control various server features on Apache based web servers.



Step 1 : Create .htaccess file in your application root directory

Step 2 : Write following code into .htaccess file which you have created




Step 3 :  Modify config file

open config file from application -> config -> config.php

//  Find the below code

$config['uri_protocol'] = "AUTO"

//  Replace it with below code

$config['uri_protocol'] = "REQUEST_URI" 
 
 

Step 4 : modify httpd.conf file

open httpd.conf file from C:\wamp\bin\apache\apache2.2.8\conf

find #LoadModule rewrite_module modules/mod_rewrite.so

and just remove # from the beginning of the line   

 

You are done ...

 

Comments