Answer the question
In order to leave comments, you need to log in
Setting up a multi-tenant application on hosting?
I am developing a site on Yii2 (advanced template), which will consist of several applications:
admin.domain.com => Приложение админки (папка /backend)
domain.com => Приложение главной страницы сайта, типа лэндинга (папка /landing)
companyID*.domain.com (т.е. *.domain.com) => Приложение (или сервис) для подключенных к сайту компаний,
у всех похожий функционал и для всех одна общая база (папка /frontend)
<VirtualHost *:80>
DocumentRoot "E:/xampp/htdocs/domain.com/admin"
ServerName admin.domain.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "E:/xampp/htdocs/domain.com/landing"
ServerName domain.com
ServerAlias www.domain.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "E:/xampp/htdocs/domain.com/company"
ServerAlias *.domain.com
</VirtualHost>
Answer the question
In order to leave comments, you need to log in
On many shared hostings, you can make several domains link to one folder. Usually through their web interface.
Well, there, along the way, you can analyze it in code or in .htaccess and slip the necessary logic depending on the domain.
Yii is especially useless here.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question