Redirect To Different Login Page Based On Controller


If the session expires, it gets redirected to /site/login. I am able to change the link using loginUrl in config/main.php. But I have a login page in another controller which is different. When the session expires, the pages inside this controller gets redirected to the same /site/login. Is there a way I can redirect that controller login to different login page (/user/login) ?

config file

return array(


    // application components

    'components' => array(

	'user' => array(

	   'loginUrl'=>array('/user/login'),//<-like this





This changes the login for all. I need to change only for a particular controller login redirected to a different login page.

In controller

    public function accessRules() {

	return array(


		'users' => array('?'),

		'deniedCallback'=>function() {Yii::app()->controller->redirect(array ('user/login'));},




It didn’t. Any other solution ??

Please see this link

I hope it may be helpful.