1

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 1

Answer 2 (This gives me "Object not found!" error)

Answer 3

Answer 4

Mikel Granero
  • 379
  • 6
  • 15

2 Answers2

1

I modified the .htaccess file adding this line:

RewriteBase /YOURPROJECTFOLDER/

so:

RewriteEngine on
RewriteBase /ShopCaseCodeigniter/
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA] 
Mikel Granero
  • 379
  • 6
  • 15
0

Change the settings in your apache server httpd.conf

AllowOverride All -> AllowOverride FileInfo