Modules And Urls

Hi everyone,

I have the module ‘auth’ with the controller ‘auth’. This module contains the controller ‘auth’. I want to use two actions in this controller: ‘login’ and ‘logout’. But I do not want to have URLs like /auth/auth/login, /auth/auth/logout. How can I remove a module name from URL? It works very well in CodeIgniter but in YII I really do not know how to do it. I do not want to create two separate controllers: LoginController and LogoutController and I think it’s not right. Can anyone help me? Thank you, anyone.

You need to configure a URL route in you main.config. Since you want a shortened URL, I think you should make a specific match so other controllers in your module aren’t affected.

Try something like (not tested):




array('auth/auth/login', 'pattern' => 'auth/login'),

array('auth/auth/logout', 'pattern' => 'auth/logout'),



Or use mod_rewrite

Matt