WP Cloud now supports domain-based multisites.
This is possible with the new canonicalize_aliases site meta. Setting canonicalize_aliases to false instructs WP Cloud to not redirect aliases to the primary domain and allows the site to serve those aliases directly. This enables domain-based multisite networks to function.
To test domain-based multisites, follow these steps:
- Complete the single site to multisite conversion steps and select the sub-domains/domain-based multisite option.
- Set the site’s
canonicalize_aliasessite meta tofalsevia the WP Cloud Atomic API. - Add the domains you wish to be handled by the site to the site’s aliases via the WP Cloud Atomic API.
- Add
define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST'] ?? DOMAIN_NAME);to the site’swp-config.phpto enable logins across different domains. - Map domains to the subsites. For example, update the Site Address (URL) to use one of the additional domains via WP-Admin.
Note that this will disable any existing redirects that are in place for aliases and it will also require that your hosting client, or your end customer, handle all redirects going forward, including canonicalizing things like www, or no-www.
Currently, DKIM signing will only be available for messages sending from an address belonging to the primary domain alias.
In general, we don’t recommend using this setting unless you have an active subdomain or multi-domain WordPress install.
If you set this value to true on an existing sub-domain or multi-domain multi-site it will start redirecting all of the aliases to the primary domain with 301 redirects.
FAQ
- Do all domains or subdomains that the site wants to be served have to be added to the site as an alias?
- Yes.
- Is there support for wildcards?
- Not at this time.
- Do all subdomains of the primary domain work automatically and redirect?
- No, see above.
- How do you handle logins across different domains?
- By settings
define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST'] ?? DOMAIN_NAME);
- By settings
- Will WP Cloud handle DKIM signing for these additional domain aliases and their associated sites?
- At this time, only the primary domain, and messages sent from an address belonging to it, will be signed.