Platform and Custom Domains

Work with platform domains or connect custom domains in the Site Dashboard, then redirect requests via PHP to standardize traffic on HTTPS and a primary domain.


A domain name is the web address or URL used to visit your site. The Domain Name System (DNS) resolves human-readable names like into machine-readable IP addresses like All Pantheon sites are accessible via platform domains, and you can easily connect your own custom domain to paid sites.

Get WebOps Training

Optimize your dev team and streamline internal workflows. Pantheon delivers custom workshops to help development teams master our platform and improve their internal WebOps

Platform Domains

Pantheon issues platform domains for all environments. Each environment (Dev, Test, Live, each Multidev) is accessible via the platform domain, matching the following patterns:


All platform domains are available over HTTPS. Redirecting to HTTPS during development and testing is a good best practice to ensure you are ready to go live with HTTPS. See Redirect to HTTPS for more information.


Pantheon serves a default robots.txt that disallows crawlers on platform domains (/*, /*, /*, and /* Crawlers are allowed on the Live environment for requests served with a custom domain (e.g., If you attempt to access your Live environment with a platform domain, even if you have a domain associated with the environment, the default robots.txt will be served.

Pantheon does not allow crawlers on Dev, Test, or Multidev environments. Adding a custom domain to an environment other than Live will not permit crawlers to that environment.

Custom Domains

If you don't already own a domain name, register one with a third-party provider. Pantheon is not a domain registrar, but we've created documentation for several popular DNS managers:

Connect your custom domain on the Site Dashboard, and point DNS at Pantheon to trigger automated HTTPS provisioning.

A paid plan is required to connect custom domains to your site, up to the following limits:

BasicPerformance SPerformance MPerformance LPerformance XLElite
Custom Domain Limit (per site)510153570270
Free and managed HTTPS


Add all domains ( and are different domains!) you want to resolve to Pantheon within the Site Dashboard, for each respective environment, as described in Launch Essentials. Automatic resolution of domains and wildcards are not supported.

Add a Custom Domain

  1. From your site dashboard, for the environment you want the domain to point to (usually Live), click on the Domains / HTTPS tab.

  2. If no domains have been added yet, click Connect Live Domain:

    Adding a first domain to the Site Dashboard

    If one (or more) domains have already been added, click Connect Domain:

    Adding an additional domain to the Site Dashboard

  3. Enter the domain you'd like to add in the "Enter domain to connect" field, then click Connect Domain:

    Adding a domain to the Site Dashboard

  4. After adding your domain, you'll be automatically taken to the domain's "Details" page where you will see both the current DNS records detected (the "Detected Values"), as well as the values to be added at your DNS host ("Required Values"):

    Custom domain Details page

  5. Add the values to your DNS management service. For more details, see Introduction to Domain Name Services.

  6. You will also see an option to choose a primary domain:

    Set the primary domain in the Site Dashboard

Primary Domain

Pantheon uses the term primary domain to refer to a single domain used to serve all traffic from a site. For example, configuring as the primary domain means that requests to (or any other domain connected to the environment) all get redirected to This assumes that you have added both and to the Site Dashboard.

Redirecting all traffic to a primary domain is a best practice for SEO since it avoids duplicate content. It also prevents session strangeness, where a user can be logged in to one domain but logged out of other domains at the same time, and it can make it easier to measure and monitor website traffic.


Redirects cannot be managed via .htaccess, which is ignored on our platform. For details, see Configure Redirects.

Set a Primary Domain via the Dashboard

  1. From the environment you want to set a primary domain for (typically Test or Live), navigate to Domains / HTTPS.

  2. Ensure that all domains have been added and are listed.

  3. In the Choose Primary Domain section, select the domain to which traffic should be redirected, and click Save Configuration.

Set a Primary Domain with Terminus

  1. Install or upgrade to the latest version of Terminus.

  2. Use Terminus to add the primary domain. In this example, replace my-site with your site name, and live if you'd like to set it for a different environment, and with your primary domain:

    terminus domain:primary:add

Redirect to HTTPS

It's a best practice for SEO and security to standardize all traffic on HTTPS and choose a primary domain. Configure redirects to the primary domain with HTTPS in pantheon.yml

Redirect with PHP

If your site configuration prevents you from setting the primary domain from the platform level, you can use PHP redirects:

For more redirect scenarios, see Configure Redirects.

Vanity Domains for Organizations

Pantheon Partners, Strategic Partners, Enterprise accounts, Resellers, and OEM Partners have the ability to provision a custom vanity domain for each environment on every site running on the platform, in addition to the default platform domain (

For details, see Vanity Domains.


Failed cache clears, search and replace, or Drush and WP-CLI operations

All redirect logic should include the php_sapi_name() != "cli" conditional statement to see if WordPress or Drupal is running via the command line. Drush and WP-CLI are used by the platform for operations like cache clearing and search and replace, so it is important to only redirect web requests, otherwise the redirect will kill the PHP process before Drush or WP-CLI is executed, resulting in a silent failure:

[notice] Command: site.env -- 'drush <command>' [Exit: 1]

Infinite Redirect Loops


Errors referencing too many redirects may be a result of using the $_SERVER['HTTP_X_FORWARDED_PROTO'] variable within redirect logic located in your site's wp-config.php or settings.php file.

Resolve this error by replacing the offending redirect logic with the recommended code samples in the above section and for your specific use case.

Modules and Plugins

Modules and plugins that support managing redirects in the Site Admin interface can produce redirect errors when repeating or conflicting with redirects managed via PHP in your site's configuration file. Some examples include:

WordPress plugins: Redirection, Quick Page/Post Redirect, Safe Redirect Manager, Simple 301 Redirects

Drupal modules: Language (when using URL detection), Securepages, Redirect

When troubleshooting a redirect loop, you may want to deactivate any module or plugin that may be providing its own redirect logic.

Mixed-mode Browser Warnings

Replace http:// in the site's database and configure your CMS to assume users are visiting via HTTPS and the site’s primary domain. Templates for example should reference HTTPS in absolute CSS and Javascript sources, even when accessed with HTTP.

CNAME Record Workaround

If your domain's DNS configuration relies on an existing MX or TXT record that intentionally disallows CNAME records, you'll need to use A and AAAA records to configure DNS for subdomains (e.g., instead of CNAMEs.


Replace in the following URLs with the target environment's platform domain.

  1. Identify the required A record value by querying the target environment's platform domain using a free online tool, such as

  2. Do the same for the required AAAA values. For example,

  3. Log in to your DNS host and create two AAAA records and one A record for the desired subdomain (e.g., www) using the values returned in the steps above.

Test Domain Names Before DNS

You can modify your local hosts file to validate domain-specific settings before DNS is in place.

Note that modifying the hosts file usually requires administrative privileges from the OS.

The location of the hosts file varies depending on your operating system:

  • MacOS / Linux: /etc/hosts
  • Windows: C:\\Windows\System32\Drivers\etc\hosts

Add lines to your operating system's hosts file in the following format:

In the example above, replace the IP addresses with those provided by Pantheon, and the domains with your own.

See Also