This question has been answered a few times, but the answers are not working for me. I recently reinstalled Windows 10, so the XAMPP installation is a clean one, but it used to work in my last PC. rewrite_module is enabled.
When I go to http://localhost
, my app redirects me to http://localhost/login
, but it says 404 until I type http://localhost/index.php/login
My config.php
$config['base_url'] = 'http://localhost';
$config['index_page'] = '';
In the .htaccess file of the codeigniter's root folder:
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
Solutions I tried:
Answer 2 (This gives me "Object not found!" error)