---
title: Setting domain names for sites
related:
  - https://docs.kentico.com/k82/configuring-kentico/search-engine-optimization.md
  - https://docs.kentico.com/k82/multilingual-websites/setting-up-multilingual-websites/setting-default-languages-for-users-and-visitors.md
  - https://docs.kentico.com/k82/multilingual-websites/setting-up-multilingual-websites/configuring-urls-for-multilingual-websites.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

The [Domain name](http://en.wikipedia.org/wiki/Domain_name) is one of the basic properties that you assign when [creating new sites](https://docs.kentico.com/k82/configuring-kentico/managing-sites/installing-new-sites.md). 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:

1. Open the **Sites** application.
2. Edit () the site.
3. Type the domain into the **Site domain name** property on the **General** tab.
4. Click **Save**.

> **Info:** **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](https://docs.kentico.com/k82/multilingual-websites.md).

To create a domain alias for your website:

> **Note:** **Note**: You need to have a valid [license](https://docs.kentico.com/k82/configuring-kentico/managing-sites/managing-site-licenses.md) for every domain alias. Domain alias licenses are free of charge if you already own a license for the main domain.

1. Open the **Sites** application.
2. Edit () your site.
3. Select the **Domain aliases** tab.
4. Click **New domain alias**.
5. 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.
6. (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.
7. 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](https://docs.kentico.com/k82/configuring-kentico/search-engine-optimization.md) 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

1. Open the **Sites** application.
2. Edit () your site.
3. Select the **Domain aliases** tab.
4. Edit your aliases.
5. Type the target URL into the **Redirect URL** property.

   > **Info:** Use [macro expressions](https://docs.kentico.com/k82/macro-expressions.md) 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
6. 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.

1. Open the **Settings** application.
2. Go to **System** **-> Performance**.
3. Under **Output caching**, enable **Output cache variables - domain**.
4. **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_.
