Codeigniter does not find Controller

Asked

Viewed 274 times

0

My website is published on IIS

servidor\c\inetpub\wwwroot\site

There are other sites in the wwwroot folder each in your directory (site2, site3, site4... etc)

In Routes.php the default controller is pointing to the home.

$route['default_controller'] = 'home';

The question is: When calling the site it normally opens the home (server/site/home), however, when I try to access any other controller (via link or directly in the url) it returns error 404. ex: server/site/administration (in localhost this error does not occur).

The impression I get is that the CI is understanding that the controller administration (for example) is not inside the controller directory of the CI structure, or that there is more directory until the controller ex: controller/site/administration.php

How can I fix this?

  • controller/site/Administracao.php - The CI 3 version has this detail

2 answers

0


If you are using CI 3, you need to set (on some servers), your controller both the file name, and the controller name with uppercase letter.

Class Administrador extends CI {
    function index(){
        return "Teste";
    }
}

Your file is called Administrator.php, with the first letter capitalized. The same goes for the model. Model_administrador e Model_administrador.php

0

In the config.php file inside the config folder you have $config['base_url']. You need to reference the folder /site

Browser other questions tagged

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