Codeigniter 3.0 giving 404 not found

Asked

Viewed 4,688 times

5

I installed the Codeigniter 3.0 in my apache and when I have access http://localhost/Azzunet/login he returns me error 404 not found. The files of controller is correct and views also (only has HTML). What happens to give this problem in version 3.0 ?

login.php (controller)

<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Login extends CI_Controller {

    public function index()
    {
        $this->load->view('login');
    }
}
  • http://localhost/Azzunet directs you to the welcome controller?

  • I also had this problem and I managed to solve by putting the first letter of the file name be it a controller, model and view in uppercase.

4 answers

2

Three cases:

  1. Check in your file routes.php, you have set your main route, if in the class Login

  2. Check whether the index.php is "in the way"

  3. Builder

    • Include the class constructor with the call parent::__construct();
  • I did all this and nothing. It keeps giving 404. CI 2.2 works well

  • See last change above!

  • I have the same problem and can only access by placing the index.php/login

1

In my case the problem started to happen when I migrated the site to a new environment, and started to give 404 in all subpages. The problem was Apache configuration.

I edited httpd.conf, overriding all instances of Allowoverride None for Allowoverride All (lines 231 and 268 in my case). I restarted Apache and everything worked normally.

0


Codeigniter 3 requires controller files to be capitalized.

In your briefcase controllers, rename the file login.php for Login.php.

0

Two years too late, but someone’s looking for a solution and falls in. So there you go.

Make sure you don’t have a controller with the same name as the subfolder. I had the following, controller/site/programsDOsite.php controller/crm/programsDOcrm.php

when I created a controller/crm.php, it stopped accessing the controller/crm/programsDOcrm.php folder

Browser other questions tagged

You are not signed in. Login or sign up in order to post.