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

2 Answers 2

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] 
Sign up to request clarification or add additional context in comments.

Comments

0

Change the settings in your apache server httpd.conf

AllowOverride All -> AllowOverride FileInfo

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.