how to configure the url ?

Hi, am starting to create an api module inside the frontend directory of yii2 whereby the ap module

has these directory structures:




frontend/

        /api/

            /controllers/

            /models/

            /views

                  /layouts/

                  /simulator/

            ApiModule.php



if in production I would want it to have something like these examples




api.mydomain.com/user

api.mydomain.com/login



how to do that in the urlRules and urlManager?

where should I put it?.

note: I used the advanced package of Yii2

currently, in my localhost, when i tried to access




localhost/myapp/frontend/web/index.php?r=api



am getting an error