Remove index.php from codeigniter

PHP CODE IGNITER

Posted on 2015-01-26 09:06:46


Please do this steps : 

1. First check mod_rewrite is enabled or not. If not, please enable mode_rewrite. Normally, it's enables by default. 

2. After that create .htaccess file in your root folder of codeigniter.

 Copy this below code  and paste into that .htaccess file

RewriteEngine On
 
RewriteCond $1 !^(index\.php|resources|robots\.txt)
 
RewriteCond %{REQUEST_FILENAME} !-f
 
RewriteCond %{REQUEST_FILENAME} !-d
 
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

3. After that change into the config.php of codeigniter

$config['index_page'] = 'index.php';    
to   $config['index_page'] = ' ';
Done ! Enjoy !!!