Thursday, July 14, 2016

Remove index.php using .htaccess : Codeigniter tutorial 6

   No comments     
categories: 

To remove 'index.php' from CodeIgniter URL, we need to make some changes in the configuration file.

Step 1 
open application/config/config.php
search for the line 
$config['index_page'] = "index.php";
and remove 'index.php' from that line.
($config['index_page'] = "";)

Step 2

Create a new file inside Codeigniter folder and save it as '.htaccess'

paste the following code inside '.htaccess' file.

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

0 comments:

Post a Comment