Answer the question
In order to leave comments, you need to log in
How to make a common admin panel for several domains?
Hello!
My task is to make a system of sites that are controlled by one admin panel.
Domains like:
magazin-moskva.ru
magazin-spb.ru
magazin-rostov.ru magazin-bobruisk.ru There is only one admin
panel
for everyone, access to it via any-domain/admin/
For all sites, a template and all resources (js, css, pictures) common. The database, respectively, is also shared.
In addition, each domain has a mobile version, which has a completely different template from the main one. Access to this template will be through the third-level domain m.
m.magazin-moskva.ru
m.magazin-spb.ru
m.magazin-rostov.ru
m.magazin-bobruisk.ru
Question 1: What is the best way to organize the directory structure for such a site system, taking into account the fact that the administrator could then add any number of domains without any problems? Which template (basic or advanced) should be taken as a basis, or can it create a different directory structure altogether?
Question 2 : I will need global variables that will depend on the domain name. For example,
$gorod = 'Moscow', $gorode = 'Moscow', $goroda = 'Moscow' => for the domain magazin-moskva.ru
$gorod = 'Saint Petersburg', $gorode = 'Saint Petersburg', $ goroda = 'St. Petersburg' => for magazin-spb.ru domain
$gorod = 'Rostov-on-Don', $gorode = 'Rostov-on-Don', $goroda = 'Rostov-on-Don' => for the domain magazin-rostov.ru
Where is the best place to write such variables? Does Yii have a domain name variable, or can you just use $_SERVER['HTTP_HOST']?
Answer the question
In order to leave comments, you need to log in
There is only one admin panel for everyone, the entrance to it is via any-domain/admin/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question