I have a Yii2 advanced project. I have MyCompanyController.php in the frontend controllers and I want to add a subdomain to this controller so I did this :
'urlManager' => [
'rules' => [
'/' => 'site/index',
'http://co.example.com' => 'my-company/index', // Not work :-(
'http://co.example.com/<action>' => 'my-company/<action>',
...
]
]
Now this code is working perfectly and when I open http://co.example.com/index my index action gets rendered, But when I open http://co.example.com without mentioning the action it is not working and it calls the site controller's index action instead .