- update the site short names and host names in
config/config.hosts.php
andconfig/config.hosts.local.php
- update the database credentials in
config/db/db.*.php
with each environment’s database info - change the directory names of
config/site_1
andconfig/site_2
to the short names of your sites. Duplicate the directories for additional sites. - update the
config/site_x/env/env.*.php
files with path and url settings for that site and environment. Repeat for other sites. Note: thesite_
andparent_
variables for your parent site will both have the same values. - update the following lines in
config/config.master.php
:- update the path to the
config
folder on line 54 - update the name of your
admin.php
file on line 101 - update the path to your
third_party
folder on line 116 - update file upload directory paths on line 135
- update the path to your
templates
folder on line 184 - update the path to the
config
folder on line 280
- update the path to the
- Site paths, urls, and protocols must be hard-coded because the current host may not be the host of the site you’re editing (example: you're on site1.com uploading an image to a Site 2 upload directory). Luckily, these values rarely change so you can usually set it and forget it.
-
current_url
¤t_path
should only be used when targeting the currently loaded site (so not for upload directories, because not all upload directories point to the current site) -
the folder structure for all environments must be the same. If PROD is
/site1.com/public_html/ /site2.com/public_html/
then LOCAL, STAGE, and DEV must be that way too. Symlinks are a great way to deal with this issue.
-
only the
site_name
variable needs to be defined in each child site'sadmin.php
andindex.php
files -
The site the
system
folder lives on is referred to as the "parent site", and variables are named according to that convention. -
The site you are currently on (specifically, the domain you are on), is referred to as the "current site". So if you're on site1.com editing content for Site 2, the "current site" is still Site 1 because that's the domain you're on.
-
Each site uses 3 files for config:
env
,db
, andconfig
.env
sets up the current site’s settings, like Environment, URL, Path, Parent URL, and Parent Path.db
is for the DB settings for that environment. Since all sites use the same DB, these files are separate from the site-specific filesconfig
is for site-specific config overrides. They’re loaded at the end ofconfig.master.php
.
- if you get stuck, enable debugging in
index.php
andadmin.php
. That'll usually tell you where the problem is.