Explore the chapters:
- Introduction
- Chapter 1: Staging vs. Production vs. Development Instances
- Chapter 2: Business Manager SEO Portal
- Chapter 3: Salesforce Commerce Cloud URL Rules
- Chapter 4: Salesforce Commerce Cloud Redirects
- Chapter 5: Salesforce Commerce Cloud Robots.txt
- Chapter 6: Salesforce Commerce Cloud Aliases
- Chapter 7: Salesforce Commerce Cloud XML Sitemaps
- Chapter 8: Salesforce Commerce Cloud URL Request Analyzer
- Chapter 9: Salesforce Commerce Cloud Page Meta Tag Rules
- Chapter 10: Salesforce Commerce Cloud SEO Settings
- Chapter 11: SFCC SEO Summary
I won’t spend too much time in this section as I don’t have enough experience.
See Salesforce Commerce Cloud documentation for configuring an Alias file here.
The Aliases, or hostname alias, are files that help denote the URL request, and to an extent, the URL structure of a specific environment.
Please note that you have to write an Alias file per environment – Staging, Development, and Production.
You’ll also have to set up and register the DNS and domain names, if you’d like to see something as clean as https://stg.example.com/, otherwise you might have to lean on Salesforce’s domain structure.
The Alias file can be extraordinarily helpful when trying to build an optimal domain structure. With an Alias file, you can
- Build an international SFCC site and set up redirect behavior for each regional property
- Use or drop www. in a domain and redirect, en masse, accordingly
- Perform domain level redirects
Regarding the last bullet, I’ve used Aliases when migrating a website that consolidates multiple domains into a single domain. That is, the Alias acts as a directive on how to treat specific external domains when they enter the site. All in all, the Alias file has been a life saver for international migration projects.
The file requires the use of JSON to drive directives. See below for the basic format of an Alias file within SFCC.
"__version": "1",
"settings": {
"http-host": "httphostname",
"https-host": "httpshostname",
"job-hostnames":
{
"default":"www.my-default-host.com",
"de":"www.my-de-host.com",
"en":"www.my-en-host.com"
},
"site-path": "sitepath",
"default" : "defaultValue",
"site-path-trailing-slash" : "yes", }
"hostName1": [
{ mappingRule1 },
{ mappingRuleN }
],
"hostNameN": [
{ mappingRule1 },
{ mappingRuleN }
]
}
Please note, it can be a very powerful tool and can save you a ton of time in your optimizations but it can also lead to issues.
I had once decided to test what would happen if I delete an Alias file. I removed it from the SFCC staging site and the site had gone down. I backed up the file and then I reimported it and the site came back online.
With that, I strongly urge that when you need to touch the Alias file, open an SEO dev ticket and consult with development resources for support.
In certain areas of the site, particularly the sitemap, you need to have an Alias file to enable functionality.
When something is amiss on a SFCC site and someone asks me what the issue is, depending on the issue, one of the first things I’d check is Alias file.