I have a problem. I need to remove index.php from URL in CodeIgniter framework. Anybody can help me?
How to remove index.php in CodeIgniter?
697 Views Asked by Anwar Hossain At
3
There are 3 best solutions below
0

To avoid "index.php" from codeigniter url, follow the steps below.
1.Open config.php from system/application/config directory and replace
$config['index_page'] = “index.php”
by
$config['index_page'] = “”;
2.Create a “.htaccess” file in the root of CodeIgniter directory (where the system directory resides), open the file using your favorite text editor, write down the following script and save it:
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
3.In some case the default setting for uri_protocol does not work properly. To solve this problem just replace
$config['uri_protocol'] = “AUTO”
by
$config['uri_protocol'] = “REQUEST_URI”
from system/application/config/config.php
You just need to create .htaccess file in project folder and write:
I hope You Understand..