Change url structure

Hi Yii2 team
I want to know that, is it possible that change the URL structure? for example:
My domain is : www.test.com
I want make a new module that each user has a exclusive domain and when it calls the URL would be like www.aaa.test.com
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 www.david.test.com

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)?://you-domain.net/some/path" => 'controller/action',

that’s how URL rule should look like.

1 Like