Multiple domains can point to a VIP platform environment, but only one domain can be the primary domain. This is true for WordPress single site environments, WordPress multisite environments, and Node.js environments.
Assign a primary domain
All VIP Platform environments are initially created with a convenience domain assigned to them. Convenience domains are intended for temporary use by production environments during development and preparation for launch.
- On a non-production environment the convenience domain can be optionally replaced by a custom primary domain.
- On a production environment the convenience domain must be replaced with a custom primary domain in order for a site(s) on that environment to be launched and accessible to public traffic.
When a primary domain is assigned to an environment, all instances of the convenience domain in the site’s database tables are replaced by the primary domain.
A custom domain that does not yet have DNS pointed to VIP can be assigned as the primary domain. Until DNS for the domain is pointed to VIP, the site will only be accessible by modifying the local machine’s hosts file.
After the domain switch, it may take up to 10 minutes for a site to receive traffic.
WordPress single site environments
Before completing the steps below, the new custom domain must already be added to the environment’s VIP Dashboard.
- Navigate to the VIP Dashboard for an application.
- Select an environment from the environment dropdown located at the upper left of the VIP Dashboard.
- Select “Domains & TLS” from the sidebar navigation at the left of the screen.
- Locate the new domain from the list of the environment’s domains.
- Select the “•••” button located to the right of the domain.
- Select “Make Primary Domain” from the overflow menu.
All instances of the previous domain in the site’s database tables will be replaced with the new primary domain.
Update a primary domain
Until a WordPress single site environment has been launched, the primary domain can be changed any number of times within the Domains & TLS panel of the VIP Dashboard.
WordPress multisite environments
For WordPress multisite environments, the primary domain can be assigned or updated by using the launch tooling in the Network Sites panel of the VIP Dashboard. The custom domain that is assigned to the main site (ID 1) is the primary domain for the environment.
In the Network Sites panel:
- For an unlaunched production WordPress multisite environment, assign a primary domain by selecting the button labeled “Launch this site” for the main site (ID 1). Follow the steps in the launch tooling to update the main site’s domain and mark the site status as “Launched”.
- For a launched production WordPress multisite environment, the primary domain can be updated by selecting “Update domain” for the main site (ID 1). Follow the steps in the launch tooling to assign or update the site’s domain and mark the site status as “Launched”.
- For a non-production WordPress multisite environment, assign or update the primary domain by selecting “Update domain” for the main site (ID 1). Follow the steps in the launch tooling to assign or update the site’s domain and mark the site status as “Unlaunched”.
Identify a primary domain
If a primary domain is already assigned to an environment, it can be identified in the VIP Dashboard or with VIP-CLI.
All custom domains that are mapped to an environment are listed in the Domains & TLS panel of the VIP Dashboard for that environment. An environment’s primary domain is indicated by a label with the text “Primary” to the right of a listed domain.
A user can list an application’s environments and a limited set of their setting values, including the primary domain, with the
vip app [ID] command.
As an example, environment details for an application with the name
mytestsite can be retrieved by running the command
vip app mytestsite. The example command output below reports that the application’s production environment is in a
launched state with the primary domain
$ vip app mytestsite
+ id: 4323
+ name: mytestsite
+ repo: wpcomvip/my-org-mytestsite
│ id │ app id │ name │ type │ branch │ current commit │ primary domain │ launched │
│ 4323 │ 4323 │ production │ production │ master │ dc23c72 │ example.com │ true │
│ 4354 │ 4323 │ preprod │ preprod │ preprod │ cb2784f │ mytestsite-preprod.go-vip.net │ false │
Last updated: February 29, 2024