G
G
Gennady Dorokhin2016-08-30 11:28:38
Yii
Gennady Dorokhin, 2016-08-30 11:28:38

How to connect multiple domains to 1 system?

Реализуем проект на Yii2.
Он чем то будет похож на www.insales.ru, только не интернет-магазины будут, а мини-сайты.
Т.е много сайтов под 1 крышей, в 1 системе по типу групп ВК.
Каким образом можно подключить домены к этим сайтам?
Например www.site1.ru - открывается 1 сайт, www.site2.ru - открывается 2 сайт.
Все настройки сайтов будут храниться в бд, т.е физически то этих сайтов не будет. Будут определенные шаблоны и настройки их отображения.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
D
Dmitry, 2016-08-30
@Itachi261092

Sites will be stored on the same hosting in the same database? Buy 2 domains. bind them to the ip-address of the hosting. in the hosting settings, bind the desired domain to the selected folder. if you want to display the same folder at all addresses, then you need to chemistry with htaccess. More precisely, the admins will come running and tell.

N
Nikita, 2016-08-30
@bitver

Dance from $absoluteHomeUrl = Url::home(true);
or
or
And generally google.

M
Maxim Timofeev, 2016-08-30
@webinar

as an option:
each domain has its own folder, they are at the same level, at the same framework level. Each site has its own entry point (index.php), as well as assets, uploads, etc. all public folders. And then customization of urlManagera.

S
SergeySL, 2016-08-30
@SergeySL

Do as Dimitri said . It's called Name-based Virtual Hosting - https://httpd.apache.org/docs/current/vhosts/name-... . In your case, the necessary directives are written in at least .htaccess, at least in httpd.conf (or vhosts.conf, depending on the OS and Apache version).

G
Gennady Dorokhin, 2016-08-30
@eXtatic Asker

But is it really possible to tie everything to one input script so that it works not as a redirect, but as if it were separate sites?
And how to set up htaccess, so that, say, in some parameter, pass what the domain was?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question