CakePHP缺少ApplicationNameController

I have had installed and configured a new CakePHP 2.4 instance. Now I wanted to implement the AuthComponent. I have had implemented the component exactly as in recent projects, too. Now I have the problem that I get the error message Missing Controller: SteadinessController. But Steadiness is the project name. I'm confused haha.

The URL I want to open is http://localhost/steadiness/users/view/2 and I will be redirected to http://localhost/steadiness/steadiness/users/login. The controller and action invoked is correct but the second steadiness is false.

Thanks a lot for help.

Alex

Can you post the code where you try to direct the user to this url?

I'm guessing it's a redirect to do with the Auth component.

In your AppController when you set up Auth there should be something similar yo:

public $components = array(
    'Session',
    'Auth' => array(
        'loginRedirect' => '/',
        'logoutRedirect' => '/',
        'authorize' => 'controller',
        'unauthorizedRedirect' => '/'
    )
);
  1. The loginRedirect tells Cake where to send users after login who went directly to the login page (they didn't try to access a restricted link whilst not logged in).

  2. The logoutRedirect tells Cake where to send users after logout.

  3. The unauthorizedRedirect tells Cake where to send logged in users that try to access a link that they do not have the priveleges for (e.g. a non-admin tries to delete an account - only admins should be able to do that).

If one of these is not set then when Cake tries to use it you get redirected to '/{app-directory}' which is NOT the same as '/'. This is most likely why your url has the domain appear twice - so Cake thinks it is looking for a controller with the same name as your domain.