Complete rewrite of Multisite Module. ("not much left from the original module and fork, but the basic idea is the same").
The basic module was written by Antti Peisa and forked by Philipp "Soma" Urlich
- Github: Multisite by Christoph Thelen aka @kixe
- Github: Multisite by Philipp "Soma" Urlich
- Github: Multisite by Antti Peisa – deprecated
- ProcessWire Forum ProcessWire Forum
It allows you to run multiple sites with different domains from a single install, using the same database, same site folder, same modules, templates and core settings.
Yes, kind of. It allows you to run multiple pw-installations with shared core files (/wire/ folder) but with site folders (templates, custom modules) and databases for each installation.
- Do not worry about page naming. The root page is defined via ID.
- FULL multilanguage support
- take in account
$template->slashUrl
settings - take in account
LanguageSupportPageNames::useHomeSegment
settings - Fallback to default 404 page if custom 404 is not set
- Throws exception in case of misconfiguration
- Access of pages residing inside a MultisitePageTree for other domains other than the corresponding domain is disallowed. (404)
- Pages inside a MultisitePageTree accessible only via url based on the corresponding domain. 404 instead of unexpected redirects.
- Page paths are set via hook in
Page::path()
andLanguageSupportPageNames::getPagePath()
instead of modifying the return ofPage::render()
- Crosslink support via the RTE (CK Editor) Link plugin
- Page view links in admin with correctly modified urls. For the branch related to calling domain only.
- You can place your root branch elsewhere, no need to place at the first child level under home.
- Support of redirects
- Install Module
- Each Domain you use must point to your ProcessWire Installation
- Setup config.php
$config->MultisiteDomains = array(
"example.com" => array( // domain name is used to map to root page
"root" => 1027, // page id
),
"example.org" => array(
"root" => 1028,
"http404" => 1029 // custom 404 page
)
"example.de" => array(
"root" => "https://example.org" // redirect
)
);
- LanguageSupportPageNames must be installed
- LanguageSupportPageNames::getPagePath() MUST BE MODIFIED hookable in core. Currently LanguageSupportPageNames::getPagePath() is not hookable. This core function must be changed to hookable otherwise language support doesn't work. Please support this feature request: processwire/processwire-requests#94
- a page name for the default language and any other language must be set for the superRoot page ($page->id = 1)
/**
* HTTP Hosts Whitelist
*
*/
$config->httpHosts = array('nomultisite.com');
/**
* Multisite domain settings
*
*/
$config->MultisiteDomains = […];
/**
* Merge Multisitedomains in $config->httpHosts to set the correct $config->httpHost
*
*/
$config->httpHosts = array_unique(array_merge($config->httpHosts, array_keys($config->MultisiteDomains)));
The following API Vars are modified by the module.
$page->url
$page->httpUrl
$page->path
$page->localPath()
$page->localUrl()
$page->localHttpUrl()
This module doesn't provide new API vars and your templates doesn't know about this module (except the modified API vars). You have to use the ProcessWire API in the same way as in a single site environment.