New Subsites and Multisite Custom Domains

The most powerful feature of WordPress is the ability to have multiple sites under one parent WordPress Multisite environment. This tutorial will help you add new sites to your WordPress Multisite environment and map a custom domain to the new site.


Create Subsite

  1. Map your multisite’s main site domain
  2. Subdomain multisite networks only, (EX: subsite.domain.com), add your new subdomain to the User Portal
  3. Create the subsite within your WordPress multisite:
    1. Open your websites wp-admin
    2. Navigate to My Sites > Sites (/wp-admin/network/sites.php)
    3. Click Add New at the top
    4. Fill out all fields:
      • Site Address — Never use “www”
        • Subdomain: siteaddress.yourdomain.com
        • Subdirectory: yourdomain.com/siteaddress
      • Site Title — Title of the site, can be changed later
      • Admin Email — Set as the initial admin user for the subsite

Map Custom Domain to Subsite

You can also map a custom domain 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 make sure you have:

  1. Added your new domain to the User Portal
  2. Updated DNS for your new domain

NOTE

Do not map a subsite domain using both methods below, or you will receive 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 your custom domains 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.

  1. Open your multisite Network Admin
  2. Open the Sites page
  3. Click Edit near the subsite you’re updating
  4. Change the Subsite Address (URL) to your new custom 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, we recommend you switch to using Native Domain Mapping instead.

  1. Ensure the MU Domain Mapping plugin is installed and activated
  2. Using SFTP, move sunrise.php from the plugin directory into wp-content/
  3. Edit wp-config.php add: define( ‘SUNRISE’, ‘on’ );
  4. Open your multisite Network Admin
  5. Select Settings > Domain Mapping on left menu
  6. Fill in the Site ID for the subsite you are mapping
    • You can find the Site ID from Network Admin > Sites, in the ID column
  7. Fill in the custom Domain for that subsite

NOTE

Do not define COOKIE_DOMAIN in your wp-config.php as it conflicts with logins on your mapped domains.


Domain Wildcarding

When adding subsites to a subdomain multisite, you’ll find that each new subdomain also needs to be added to the Domains section of your 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:

  1. Ensure DNS for the top-level domain (non-www) is pointed to WP Engine
  2. Install a wildcard SSL certificate for the domain (i.e. *.yourdomain.com)
  3. Enable domain wildcarding on your top-level domain:
    1. Log in to the User Portal
    2. Select the environment name
    3. Open Domains from the menu
    4. Select the 3 dot menu icon to the right of the domain
    5. Click Set as wildcard
  4. 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 your 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.

  1. Upgrade your domain to Advanced Network
    • Enable the modern network, but do not update your DNS records at this time.
  2. Confirm your domain has a wildcard SSL uploaded, or upload a new wildcard SSL certificate for the domain
  3. Enable domain wildcarding on your top-level domain:
    1. Log in to the User Portal
    2. Select the environment name
    3. Open Domains from the menu
    4. Select the 3 dot menu icon to the right of the domain
    5. Click Set as wildcard
  4. 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.
  5. Update DNS records to point to Advanced Network

Once domain wildcarding has been enabled, any subdomain for which DNS has been pointed to your WP Engine site, will direct traffic to the environment where domain wildcarding is enabled.

If any issues occur, we recommend 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 you are using subdomains of your multisite’s main site domain but on separate WP Engine Environments, we do not recommend enabling Domain Wildcarding. If subdomains are added to multiple environments, and one environment has Domain Wildcarding enabled, you will run into configuration issues with these subdomains resolving properly.
  • If you plan to have a subdomain in use on another site, we recommend 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 you are using a custom domain as your 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, you will also need to ensure that a DNS record is set up with your DNS provider for each of your subdomains.

We recommend creating a wildcard CNAME record that is pointed to your environment.wpengine.com domain. If you have questions regarding how to set up this record, we recommend contacting your DNS provider for host-specific guidance. For example:

PurposeTypeValueTarget/Hostname
WildcardCNAME*environment.wpengine.com

Domain Wildcard and SSL

Domain Wildcarding does not directly add the domain to your User Portal Domains page. If you require an SSL, we recommend a wildcard SSL. For all plans, excluding Lite and Startup, we can also import a third party wildcard SSL.

You will need a valid wildcard SSL certificate in order to validate domain wildcarding on Advanced Network or Global Edge Security.


NEXT STEP: Add an SSL to your domain

Still need help? Contact support!

We offer support 24 hours a day, 7 days a week, 365 days a year. Log in to your account to get expert one-on-one help.

The best in WordPress hosting.

See why more customers prefer WP Engine over the competition.

Chat with us!