Reputation: 9049
Well I'm not really sure how you guys implement mod_rewrite with codeigniter, and I'm not even sure If I need to do that right now. What I want is to get rid of the index.php that trails the root directory, so eliminate it from www.mydomain.com/index.php/mycontroller and just have www.mydomain.com/mycontroller/
Upvotes: 0
Views: 5584
Reputation: 2042
In addition to what everyone above said about .htaccess, you also have to set
$config['index_page'] = 'index.php';
to
$config['index_page'] = '';
in your /application/config/config.php file
Upvotes: 4
Reputation: 8012
you can place this in .htaccess to remove index.php from url
#### Remove index.php ###
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
#### index.php ###
Upvotes: -1
Reputation: 1863
You can hide your index.php by modifying your .htaccess file. For example,
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
You can find out more about CodeIgniter URLs here: http://codeigniter.com/user_guide/general/urls.html
Upvotes: 2