Setting up several sites in one installation
This page is for website creators who build more than one site on one Exponential installation: several brands,
regions, or a main site and microsites. Each site is one or more siteaccesses: a name, its settings in
settings/siteaccess/<name>/, and a rule for which requests it answers
(10.2 Siteaccesses and site addresses).
Contents
- Shapes of a multisite
- Step by step: a second site
- Settings per site in an extension
- Links between the sites
- Editors and the administration
- Trade-offs
Shapes of a multisite
| Shape | How |
|---|---|
| Separate content per site | one folder per site under the root; each siteaccess uses its folder as root |
| Shared content, different designs | the same root, a different SiteDesign per siteaccess |
| One site in several languages | one siteaccess per language (Building a multilingual site) |
| Each site in its own extension | settings that apply only while the site's siteaccesses run (Per-site settings) |
The default site package, sevenx_multisite, is itself a multisite installation.
Step by step: a second site
Content. Create a folder
Site Bunder the root and note its node ID.Siteaccess. Copy
settings/siteaccess/sitetosettings/siteaccess/site_band set insite_b/site.ini.append.php:[SiteSettings] SiteName=Site B SiteURL=www.site-b.example IndexPage=/content/view/full/<node id of Site B> DefaultPage=/content/view/full/<node id of Site B> [DesignSettings] SiteDesign=siteb AdditionalSiteDesignList[] AdditionalSiteDesignList[]=simpleand in
site_b/content.ini.append.php:[NodeSettings] RootNode=<node id of Site B>Register and match it in
settings/override/site.ini.append.php:[SiteAccessSettings] AvailableSiteAccessList[]=site_b RelatedSiteAccessList[]=site_b MatchOrder=host;uri HostMatchType=map HostMatchMapItems[]=www.site-b.example;site_bKeep the entries the installer wrote for the other siteaccesses; add yours.
HostMatchMethod=startalso lets a test host such aswww.site-b.example.test.localreach the same siteaccess (Siteaccess by host prefix).Web server and DNS. Add the host name to DNS, to the web server or Velocity, and to the certificate (Going live: hosts, HTTPS and siteaccesses).
Clear caches and check.
php bin/php/ezcache.php --clear-tag=ini --allow-root-user curl -sI https://www.site-b.example/ | head -1Let the administration know the site: add
site_bto[SiteSettings] SiteList[]of the admin siteaccess, so previews and links can use it.
Settings per site in an extension
When each site is an extension (extension/site_b/), it can carry settings/override/ files that apply only while
one of its own siteaccesses runs, plus settings/siteaccess/<name>/ per siteaccess. Clearing the INI cache clears it
for every site (Per-site settings inside extensions). That keeps
each site's design, settings and templates together in one Git repository.
Links between the sites
A link in the content of site A to a page that lives in site B's folder must point to site B's host. The ezurlmultisite
extension resolves such links (Links to content of another site).
Editors and the administration
- One administration can serve every site; roles limited by subtree keep each team in its site's folder (Roles and policies).
- Several administration siteaccesses are possible when teams should not see each other's sites at all.
Trade-offs
| Strength | Constraint |
|---|---|
| one kernel, one set of extensions to update and secure | every site moves with the others on an upgrade |
| shared content and media, one search index | a heavy site slows the others on the same machine |
| one backup | a restore restores all sites |
Write the trade-off into the plan (Planning multisite and multilingual projects).
Related pages
- Building a multilingual site
- Structuring the content tree
- Multisite siteaccess cookbook (
doc/eng-us/examples/cookbook/multisite-siteaccess.md) - Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.