Change url structure

Hi Yii2 team
I want to know that, is it possible that change the URL structure? for example:
My domain is :
I want make a new module that each user has a exclusive domain and when it calls the URL would be like
I mean the module call the username and set it on the URL before base URL
another example: username is David so my URL should be

Thanks in advance
Please share your idea

Yes. Sub-domains are supported by URL manager.

Personally, I’d not recommend that if that’s a single application because of navigation issues, cookies, search engine optimization etc.

Thanks dear Alexander
Could you please tell me more and explain about these solution?

"http(s)?://" => 'controller/action',

that’s how URL rule should look like.

1 Like