Pages

Saturday, August 06, 2011

CodeIgniter 2.x.x : Remove 'index.php'

There is a couple of things that changed since the last release. It’s been mentioned here a couple of times in the last week, but this is what has worked for me:

for htaccess


RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

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

or


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


both work for me. Be sure to change

$config['uri_protocol']="REQUEST_URI";
in config.php, the auto option doesn’t work.

Don’t forget the $system_path and $application_folder in index.php to your folders.

Source : Coccodrillo
http://codeigniter.com/forums/viewthread/180566/

No comments: