On my local machine I have .htaccess in the web route that reads:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
But when I attempt to visit the following url – localhost/admin – I get “404 Not Found”. I
I tried editing the last line to include a leading slash:
RewriteRule ^(.*)$ /index.php/$1 [L]
but that didn’t work.
I made sure mod_rewrite was enabled:
sudo a2enmod rewrite
My config settings were change in application/config/config.php to read:
$config['index_page'] = '';
I’ve checked my controller spelling and it appears to be correct (if I visit localhost/index.php/admin it loads the controller).
So, according to your last comment – you have your
.htaccessturned off.You can turn it on by specifying
AllowOverride Allin your apache configsPS: try find current
AllowOverridesettings, most likely it is specified toNoneor something more restrictive thanAll