Codeigniter URL not working without index.php Codeigniter URL not working without index.php codeigniter codeigniter

Codeigniter URL not working without index.php


i aggree with Vlakarados, but i will share my .htaccess setting

RewriteEngine onRewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule ^(.*)$ ./index.php?/$1 [L,QSA]

its work perfectly.

i hope that's work to for your CI website


The most common solution to this problem is usually the missing question mark ? after index.php in .htaccess, so

RewriteRule ^(.*)$ index.php/$1 [L]

should be

RewriteRule ^(.*)$ index.php?/$1 [L]

E.G. on my Windows XAMPP, I do not need the "?", but in a Linux hosting environment it is usually required.


You might not have rewrite_module module loaded.Try running below command.

sudo a2enmod rewrite