IshaS
IshaS

Reputation: 837

The requested url not found error in codeigniter

I have created a login page using codeigniter framework.it works well. After install apachi,mySql and php again my website login is not working. I can go to "http://localhost/test/" and login button is there. After The requested URL /test/user/user/login was not found on this server.When I click the login button redirect to the page "http://localhost/test/user/user/login" and it says "The requested URL /test/user/user/login was not found on this server" How can I solve this? It works well before I format the computer and install php again.

Upvotes: 2

Views: 13880

Answers (4)

Bennoxy
Bennoxy

Reputation: 11

Your .htaccess file maybe inside the application folder. Move it outside the application folder, also ensure to re-write the .htaccess file as follows:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

Upvotes: 1

Reus
Reus

Reputation: 21

I have had a lot of problems trying to fix this issue and finally I have figured out that without changing index.php field within the config.php file, you have to specify the address like this; http://localhost/codeigniter_folder_name/index.php?/controller_name

This has solved it for me.

Upvotes: 2

IshaS
IshaS

Reputation: 837

sloved after changing AllowOverride None to AllowOverride All in /etc/apache2/sites-enabled/000-default .

Upvotes: 4

Jenz
Jenz

Reputation: 8369

Why you have used user twice like http://localhost/test/user/user/login. Here, user is the name of the controller. So the url should be like http://localhost/test/user/login. If you are not using htaccess file ie, mod_rewrite is not enabled, then the url should be like http://localhost/test/index.php/user/login

Upvotes: 0

Related Questions