Remove index.php from your codeigniter url
posted on: 2010-04-12 19:10:21
Want to make your CodeIgniter URL's a little friendlier on the eye?
Then all you need to do is take 2 simple steps. Firstly open your application/config/config.php and set the index_page value to:
$config['index_page'] = "";
Then create a .htaccess root directory of your web application, the folder in which your "index.php" and "system" directory is located. And then put the following inside.
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
And that should be that.
