Saturday, 7 July 2012

Removing the index.php in CodeIgniter 2.0

Please follow the steps below.

1. Enable the mode rewrite module in httpd.conf in Apache.

2. Place a .htaccess file with following lines in the parent directory of the CodeIgniter installation.

   RewriteEngine on
   RewriteCond $1 !^(index\.php|images|robots\.txt)
   RewriteRule ^(.*)$ /index.php/$1 [L]

3. Remove the index.php in the config.php file as below

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

And we are good enough to go.

No comments:

Post a Comment