Setting domain names for sites
The Domain name is one of the basic properties that you assign when creating new sites. The system generates the URLs of the website’s pages and other components using the specified domain name. Every website running in the system must have a unique domain name.
To set the main domain name for an existing website:
- Open the Sites application.
- Edit () the site.
- Type the domain into the Site domain name property on the General tab.
- Click Save.
Domain name format
Enter the domain name without the http:// protocol and www prefix. Include the port number if it is different than 80.
Correct:
- mycompany.com
- partners.mycompany.com
- mycompany.com:8080
Incorrect:
- http://mycompany.com
- www.mycompany.com
Adding domain aliases
Domain aliases are alternative domain names that lead to the same website. You can add any number of domain aliases for each site. For example, if your website uses mycompany.com as its main domain and you also wish to assign the my-company.co.uk domain to the same website, you need to create a domain alias. Aliases can be particularly useful when building multilingual websites.
To create a domain alias for your website:
Note: You need to have a valid license for every domain alias. Domain alias licenses are free of charge if you already own a license for the main domain.
Open the Sites application.
Edit () your site.
Select the Domain aliases tab.
Click New domain alias.
Type the alternative domain name into the Domain alias property.
- Use the same format as for the site’s main domain name, without the protocol or www prefix.
(Optional) Set the Default alias path.
- Specifies the default page that the system displays when users access the site’s root URL through the domain alias.
- Overrides the Settings -> Content -> Default alias path setting.
Click Save.
The site is now available under the alias’s domain name.
Redirecting aliases to the main domain
You can configure domain aliases to automatically redirect users to another URL. When a visitor accesses the website through the domain alias, the system sends them to the specified URL instead.
If the only purpose of your domain aliases is to make the site available under multiple domain names, it is recommended to redirect the aliases to the website’s main domain. This is a common Search engine optimization practice that prevents duplicate web content (i.e. having multiple URLs leading to the same content).
To set up redirection for your domain aliases:
Configure the redirect URL
Open the Sites application.
Edit () your site.
Select the Domain aliases tab.
Edit your aliases.
Type the target URL into the Redirect URL property.
Use macro expressions to dynamically redirect users to the correct page, for example: {%protocol%}://domain.com{%relativepath%}
- {% relativepath %} - resolves into the current relative URL path when the redirection takes place
- {% protocol %} - resolves into the current URL scheme name (protocol) when the redirection takes place
Click Save.
(Optional) Configure output caching for the domain variable
If you are using a Default alias path for any of the domain aliases, you need to make the output cache store different data based on the different domains.
- Open the Settings application.
- Go to System -> Performance.
- Under Output caching, enable Output cache variables - domain.
- Save.
The system now automatically redirects all users to the site’s main domain. For example, if your site’s main domain is domain.com and you have domain.co.uk as a domain alias, users who access https://domain.co.uk/example.aspx are redirected to https://domain.com/example.aspx.