Custom Domain Build Example

Domains and sites can have a many-to-many relationship through custom URLs. See this relationship in action with an example where three custom domains serve one parent site with two different brands.

Required Editions

Available in: both Salesforce Classic and Lightning Experience
Available in: Enterprise, Performance, and Unlimited Editions.
Applies to: Salesforce Sites and LWR, Aura, and Visualforce sites

In this example, Example Company owns two clothing brands: Red Example and Blue Example. Their Experience Cloud sites include two sites for each brand. One is a storefront, and the other provides job listings for the brand.

The parent company owns three domains: https://www.example.com, https://www.redexample.com, and https://blueexample.com. They want visitors to access the sites for both brands from each of those domains.

Build the Site

First, the admin builds an Experience Cloud site to serve as a landing page. Because they want to drive traffic to their storefronts, this site highlights the latest trends for both brands and includes navigation links to the Red Example storefront site and the Blue Example storefront sites. The sites for Red Example and Blue Example include a header that links to the other brand’s storefront.

In Salesforce, there are five Experience Cloud sites.

  • Home–The landing page. Site path: /.

    Resulting URL: https://www.example.com/

  • Red Storefront–Storefront for Red Example brand. Site path: /shop.

    Resulting URL: https://www.redexample.com/shop.

  • Red Jobs–Job listings for Red Example brand. Site path: /apply.

    Resulting URL: https://www.redexample.com/apply.

  • Blue Storefront–Storefront for Blue Example brand. Site path: /shop.

    Resulting URL: https://www.blueexample.com/shop.

  • Blue Jobs–Job listings for Blue Example brand. Site path: /apply.

    Resulting URL: https://www.blueexample.com/apply.

Update DNS

To add the three custom domains as records on the Domain Setup page, Salesforce requires that the domains point to their org. The admin visits the page where they can add a domain to verify the canonical name (CNAME) records values to use when they configure DNS.

The admin works with their DNS provider to add a CNAME record for each domain that points to the corresponding *.live.siteforce.com value.

To serve the three custom domains over the Salesforce Content Delivery Network (CDN), the admin also adds a second _acme-challenge CNAME record for each domain as required by our Salesforce CDN partner.

Add the Domains

After each CNAME record in DNS for each domain target points to their Salesforce org, the admin can add the domains in Salesforce.

From the Domains Setup page, the admin adds three domains: one with the domain name www.example.com, one with the domain name www.redexample.com, and one with the domain name www.blueexample.com. For each domain, the admin selects the domain configuration option, Serve the domain with the Salesforce Content Delivery Network (CDN).

After the admin saves each domain record, Salesforce provisions the domains. In other words, Salesforce gets the new domains ready for activation. When the admin receives an email that each domain is ready for activation, they activate each domain.

Add Custom URLs for the Root Domains

To specify the site to load when users access their root domains, the admin sets up Custom URLs. For each Custom URL, the admin specifies the domain record, the site, and the path. The admin adds Custom URLs with these values.

Domain Site Path
www.example.com Home /
www.redexample.com Home /
www.blueexample.com Home /

When the admin adds the custom URL for www.example.com, they also select Site Primary Custom URL.

When the admin saves these changes, users who visit https://www.example.com, https://www.redexample.com, or https://blueexample.com see the content from the landing page. However, the address bar in the user’s browser shows the corresponding branded URL. Also, because the admin selected Site Primary Custom URL for www.example.com, https://www.example.com is the preferred URL for the site’s authenticated pages and email.

Add Custom URLs for the Brand-Specific Site Pages

To load the brand-specific sites for Red Example and Blue Example, the admin adds Custom URLs for the storefront and jobs sites.

Domain Site Path
www.redexample.com Red Storefront /shop
www.redexample.com Red Jobs /apply
www.blueexample.com Blue Storefront /shop
www.blueexample.com Blue Jobs /apply

When the admin saves these custom URLs, users who visit https://www.redexample.com/shop or https://www.blueexample.com/shop see the corresponding brand’s storefront. And users who visit https://www.redexample.com/apply or https://www.blueexample.com/apply see the corresponding brand’s job listings.