The task is to create a subdomain for each registered user. For example, site.com should be for this user user.site.com, and so for each user has its own subdomain. I read that this can be implemented through the service cloudflare. The site is powered by Yii2. How can this be implemented?

    1 answer 1

    The site is powered by Yii2. How can this be implemented?

    "that for each registered user a subdomain was created" - no matter what framework the site is built on. cloudflare, and nothing more.

    To be able to use subdomains in the engine (on the site), first of all, you need to prescribe aliases (ServerAlias) for each user on the server or do it immediately.

    For Apache: ServerAlias *.site.com

    • Thanks, yes ServerAlias ​​worked. - Oleksandr Barabolia
    • And on the hosting just add a subdomain * .site.com? or there may be some difficulties, cPanel control panel, hosting coretek.ru - Oleksandr Barabolia
    • With cPanel, the user will not be able to do anything (in any case, how many I have seen them - it was impossible to be anywhere). It is necessary to contact the host (and then if he agrees). With an ISP, this is just a tick in the panel. - SeVlad
    • On hosting works by adding sudomain * .site.com, and Nenad to climb into the apache settings. - Oleksandr Barabolia