[SOLVED] Moved site login

Hi I moved the login of the login page from site/login to client/login but now when I access a controller and the user is not authenticated he is redirected to site/login instead of client/login. Do you know where I can configure the new login controller?



In app/views/layouts/main.php change the link from /site/login to /client/login


Sorry I was not clear I didn’t mean to change the hyperlink, I am talking about that:

 public function behaviors() {

        return ['access' =>

                    ['class' => AccessControl::className(),

                    'rules' => [

                        [   'actions' => ['signup', 'login'],

                            'allow' => true,

                            'roles' => ['?'],


                        [   'actions' => ['logout', 'dashboard'],

                            'allow' => true,

                            'roles' => ['@'],




                'verbs' => ['class' => VerbFilter::className(),

                            'actions' => ['logout' => ['post'], ], ], ];


Let’s say someone not authenticated tries to access the dashboard, how do we configure the system to redirect the user to client/login and not site/login (current behavior).

I figured it out,

in your config file (config/main.php)

        'user' => [

            'identityClass' => 'common\models\User',

            'enableAutoLogin' => true,

            'loginUrl' => ['client/login'],