You can set or change the default controller in Yii by using the default yii2 advanced template that redirects to URL :
1) Add below code on backend main/config.php
user component :
'components' => [
'user' => [
'identityClass' => 'common\models\User',
'enableAutoLogin' => true,
'loginUrl' => [ 'yourcontroller/youraction' ],
],
2) Yii2 advanced template default controller is controllers/siteController
. You can change it to your module or controller name by putting the below configuration in main/config.php
:
'defaultRoute' => 'yourcontroller',