Multisite Subsites and Domains
The most powerful feature of WordPress is the ability to have multiple sites under one parent WordPress Multisite environment. This guide details adding new subsites to a WordPress Multisite environment and mapping a custom domain to the new subsite.
Create Subsite
- Map a multisite’s main site domain
- Subdomain multisite networks only, (EX:
subsite.domain.com
), add the new subdomain to the User Portal- If using several subdomains of the same domain, WP Engine Support team can also enable Domain Wildcarding for the environment.
- Create the subsite within the WordPress multisite:
- Open the site’s wp-admin
- Navigate to My Sites > Sites (
/wp-admin/network/sites.php
) - Click Add New at the top
- Fill out all fields:
- Site Address — Never use “www”
- Subdomain:
siteaddress
.yourdomain.com
- Subdirectory:
yourdomain.com/siteaddress
- Subdomain:
- Site Title — Title of the site, can be changed later
- Admin Email — Set as the initial admin user for the subsite
- Site Address — Never use “www”
Map Custom Domain to Subsite
A custom domain can also be mapped to a subsite, allowing it to be accessed at a completely different URL than the main site’s domain.
For example, subsite.domain.com
or domain.com/subsite
could be accessed as mytotallynewsite.com
Before proceeding:
NOTE
Do not map a subsite domain using both methods below or it will cause errors when logging in to that domain later.
Native Domain Mapping (Preferred)
In WordPress 4.5, Native Domain Mapping was added to WordPress core. This removes the need for a plugin to map a custom domain to a subsite. This is the recommended method for a new multisite and a multisite that is not already using the MU Domain Mapping method.
- Open the multisite’s Network Admin
- Open the Sites page
- Click Edit near the subsite to be updated
- Change the Subsite Address (URL) to the new domain.
- Be sure to include http or https protocol:
WordPress MU Domain Mapping Plugin (Legacy, Not Recommended)
This is no longer the recommended domain mapping method as it requires manual configuration and there is no benefit to using it over Native Mapping. For customers who are already using the WordPress MU Domain Mapping Plugin, WP Engine recommends switching to using Native Domain Mapping instead.
- Ensure the MU Domain Mapping plugin is installed and activated
- Using SFTP, move sunrise.php from the plugin directory into
wp-content/
- Edit wp-config.php add:
define( ‘SUNRISE’, ‘on’ );
- Open the site’s Network Admin
- Select Settings > Domain Mapping on left menu
- Fill in the Site ID for the subsite
- Find the Site ID from Network Admin > Sites, in the ID column
- Fill in the custom Domain for that subsite
NOTE
Do not define COOKIE_DOMAIN
in the wp-config.php as it conflicts with logins on the mapped domains.
Domain Wildcarding
When adding subsites to a subdomain multisite, each new subdomain also needs to be added to the Domains section of the WP Engine User Portal. For just a few subdomains this process isn’t so bad, but it can become frustrating for users with a large number of subdomains. WP Engine offers an option called “domain wildcarding.” Domain wildcarding will allow any subdomain, who’s DNS is also pointed to WP Engine, to direct traffic to the same environment where the apex domain (non-www) is also added.
Enable domain wildcarding on a new domain:
- Ensure DNS for the top-level domain (non-www) is pointed to WP Engine
- Install a wildcard SSL certificate for the domain (i.e.
*.yourdomain.com
) - Enable domain wildcarding on the top-level domain:
- Open the Sites page in the User Portal
- Select the environment name
- Open Domains from the menu
- Expand the 3 dot menu icon to the right of the domain
- Click Set as wildcard
- The system will attempt to locate the matching wildcard certificate for the domain:
- If a matching certificate is found, then domain wildcarding will be enabled.
- If no valid certificate is found, an error message will be displayed with further details.
Once domain wildcarding has been enabled, any subdomain for which DNS has been pointed to the WP Engine site, will direct traffic to the environment where domain wildcarding is enabled.
Enable domain wildcarding when converting to Advanced Network:
When upgrading to one of WP Engine’s advanced network, additional steps must be taken to ensure domain wildcarding remains enabled.
NOTE
Domain wildcarding is not yet supported on Global Edge Security.
- Upgrade the domain to Advanced Network
- Enable the modern network, but do not update the DNS records at this time.
- Confirm the domain has a wildcard SSL uploaded, or upload a new wildcard SSL certificate for the domain
- Enable domain wildcarding on the top-level domain:
- Log in to the User Portal
- Select the environment name
- Open Domains from the menu
- Select the 3 dot menu icon to the right of the domain
- Click Set as wildcard
- The system will attempt to locate the matching wildcard certificate for the domain:
- If a matching certificate is found, then domain wildcarding will be enabled.
- If no valid certificate is found, an error message will be displayed with further details.
- Update DNS records to point to Advanced Network
Once domain wildcarding has been enabled, any subdomain for which DNS has been pointed to the WP Engine site, will direct traffic to the environment where domain wildcarding is enabled.
If any issues occur, WP Engine recommends adding each subdomain to the environment individually.
Domain Wildcard Limitations
- Domain wildcarding is not currently supported on Global Edge Security. Each subdomain should be added manually to the relevant environment.
- If using subdomains of the multisite’s main site domain on separate environments, WP Engine does not recommend enabling Domain Wildcarding. If subdomains are added to multiple environments, and one environment has Domain Wildcarding enabled, configuration issues will occur and the subdomains may fail to resolve properly.
- If planning to have a subdomain in use on another site, WP Engine recommends adding each subdomain separately to the Domain page in the User Portal to ensure a functional and correct configuration.
Domain Wildcard and DNS Records
If using a custom domain as the multisite’s main site domain (EX: mycoolsite.com
), new subsites will be created as subdomains of that main domain automatically (EX: subsite.mycoolsite.com
). For this reason, ensure that a DNS record is set up with the DNS provider for each of the subdomains.
WP Engine recommends creating a wildcard CNAME record that is pointed to the WP Engine CNAME. If there are questions regarding how to set up this record contact the DNS provider for host-specific guidance. For example:
Purpose | Type | Value | Target/Hostname |
---|---|---|---|
Wildcard | CNAME | * | environment.wpengine.com |
Wildcard (Advanced Network) | CNAME | * | wp.wpenginepowered.com |
Wildcard (Global Edge Security) | CNAME | * | example.wpeproxy.com |
Domain Wildcard and SSL
Domain Wildcarding does not directly add the domain to the User Portal Domains page. If an SSL is required, WP Engine recommends importing a third party wildcard SSL.
A valid wildcard SSL certificate is necessary to validate domain wildcarding on Advanced Network or Global Edge Security.
NEXT STEP: Add SSL to a domain