Rename Site Controller dosn't work.

I just installed the application advanced template, For the backend controller I want to rename the SiteController to AdminController. I tried to change the name and the name of the view folder to admin but the index page shows as not found. when you access domain/admin/

What else do I need to modify for the controller to function correctly? If I login using the login link I can. The trouble seems to be coming in the the backend as a guest. I’s still trying for site/login.

I am still getting a error 404 for Route requested: ‘site/login’

The Below seems to do the trick.


'components'=>array(

    'user'=>array(

        'loginUrl'=>array('admin/login'),

        'allowAutoLogin'=>true,

),

Did I miss anything?

Yii2 looks for site controller / site action index for the default controller / action i.e. homepage. As long and you change the class name and file name you did the first part.

The next thing is in your config->main.php you need to tell it what the new site/index is since it no longer exsist




return [

	'id' => 'app-frontend',

	'defaultRoute' => 'admin/index',

...other stuff

]

Then of course all of your other links would have to be changed from site/whatever to admin/whatever