Powered by Blogger.

REMOVE INDEX.PHP From CODEIGNITER URL



By default, Codeigniter URL may look like http://www.example.com/index.php/controller/method.

To change this to SEO friendly like  http://www.example.com/controller/method we have to do some changes in .htaccess.

1. Create a .htaccess file in the root and place the below code

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

2. Don't forget to enable rewrite_module in apache modules if you didn't enable it yet.To enable it go to WAMP->Apache->Apache modules->rewrite_module

3. In the config file change index_change to empty

$config['index_page'] ="";

Also, change

$config['rewrite_short_tags'] = TRUE;


No comments