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:









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

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


am getting an error