Default Controller


I’m creating the module Admin that has some controllers - photo, movie, content, news etc. In addition, it has the AdminController that has two actions - login and logout. In this case URLs like /admin/login and /admin/logout will be handled by LoginController and LogoutController those surely does not exist :)

So how can I redirect these request to right controller?

URLs such /admin/admin/login and /admin/admin/logout looks not good :))

Thanks a lot O0


It’s pretty simple. In your config/main.php,

'urlManager' => array(

  'rules' => array(

    'logout' => 'admin/logout',



resplendent, thank you! :)