Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Yii redirect to user/login

I am noob Yii developer and I have AdminController with access rules. So this controller is enabled for only specific users, else it redirects to "example.com/site/login" but I need that it redirected to "example.com/user/login" . So can you tell me how to do this?

like image 646
Irakli Avatar asked Jan 28 '26 18:01

Irakli


1 Answers

You can change the loginUrl property of the user component, so make the following change in your main.php config file:

array(
// ......
 'components'=>array(
    'user'=>array(
        'loginUrl'=>array('user/login'),
    ),
 ),
)

Read this part in the guide.

like image 103
bool.dev Avatar answered Jan 30 '26 08:01

bool.dev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!