# Set Up Domain Redirect

The instructions below will give you insights on configuring redirects between your service's custom domains on the Edgeport platform. This guide is an essential tool for optimizing the navigation experience for your users and establishing a polished online presence.

As an example, we’ll consider a scenario where you need to establish a redirect from your *[www.{domain\\\_name}](http://www.{domain\\_name})* subdomain to the main *{domain\_name}* domain. However, the process is analogous to other cases, such as directing traffic from the main domain to the[ ](https://www.google.com/url?q=http://www/\&sa=D\&source=editors\&ust=1698089865458900\&usg=AOvVaw3qYRYeIMCkWi5mAuZBApm8)*[www](http://www).* subdomain or between two distinct domains.

The steps will be the following:

* [Add CNAME of the Required Domain](#h.gexyiaapi3td)
* [Set Redirect to Primary Domain](#h.swjsj2zxs4y)

### Add CNAME of the Required Domain <a href="#h.gexyiaapi3td" id="h.gexyiaapi3td"></a>

To begin, navigate to the ***Security > CNAMEs*** section of your service’s menu:

<figure><img src="https://539288051-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrAkU8kT3556pTePJXRV3%2Fuploads%2FSCYqFFTbkx1bplalk8RF%2Fimage9.png?alt=media" alt=""><figcaption></figcaption></figure>

Here, you will find the application domains listed in the *ADN CNAMEs* pane (located at the top). Click on the **Add New CNAME** button above this list.

In the shown pop-up, enter the address of the required domain (*[www.edgeport.info](http://www.edgeport.info)* in our case).

<figure><img src="https://539288051-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrAkU8kT3556pTePJXRV3%2Fuploads%2Faldl3bO9yOxHGZuOj1Is%2Fimage4.png?alt=media" alt="" width="443"><figcaption></figcaption></figure>

Click **Add**. The specified domain will instantly appear on the list of ADN CNAMEs.

<figure><img src="https://539288051-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrAkU8kT3556pTePJXRV3%2Fuploads%2FXwA1UsJPJv8z7bXVeyUI%2Fimage1.png?alt=media" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Important notes**:

* For the traffic to be directed to your application via a newly added CNAME, you need to add the corresponding CNAME-type record to your [DNS settings](https://docs.edgeport.com/product-docs/service-menu/routing). This record should contain the appropriate domain name stated as a ***Name***, and your project’s Edge address (displayed within the *POINTS TO* column in the screen above) stated as a ***Value***.
* If you already have an [SSL certificate](https://docs.edgeport.com/product-docs/service-menu/settings/edgessl) deployed for your service, you’ll need to [update it](https://docs.edgeport.com/product-docs/start-guide/issue-ssl-certificate/update-ssl-certificate) with the newly added domain(s) to ensure the seamless functioning of the HTTPS service before configuring the redirect.
  {% endhint %}

### Set Redirect to Primary Domain <a href="#h.swjsj2zxs4y" id="h.swjsj2zxs4y"></a>

Regardless of how many CNAMEs you have added, there is always a single *Primary* domain address. The traffic from your other servers can be redirected only to the domain that is marked as *Primary*:

<figure><img src="https://539288051-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrAkU8kT3556pTePJXRV3%2Fuploads%2FdeOCFrtjBiZhxjZRSjeX%2Fimage2.png?alt=media" alt=""><figcaption></figcaption></figure>

Initially, this label is attributed to the domain name you specified when [adding your service](https://docs.edgeport.com/product-docs/start-guide/add-a-new-service) to the Edgeport platform. However, you can designate any of the other domains as the primary one using the **Set Primary** option available for each of them.<br>

<figure><img src="https://539288051-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrAkU8kT3556pTePJXRV3%2Fuploads%2FA70zuZdDvPySB0osJt7O%2Fimage5.png?alt=media" alt=""><figcaption></figcaption></figure>

Now, to route the traffic from any of the domains to the primary one, click **Set Redirect to Primary Domain** next to the required CNAME.

<figure><img src="https://539288051-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrAkU8kT3556pTePJXRV3%2Fuploads%2F9FPfj0bbVEkQEfpgd5J5%2Fimage8.png?alt=media" alt=""><figcaption></figcaption></figure>

The incoming request to this host will start being directed to the domain labeled as *Primary*, while the domain you’ve chosen as a traffic source will be marked as *Redirected*.

<figure><img src="https://539288051-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrAkU8kT3556pTePJXRV3%2Fuploads%2F2EMLr1he3l9yr0VvTVgs%2Fimage3.png?alt=media" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Please **Note** that this change may take up to 5 minutes to be applied and up to 30 minutes to propagate fully across all PoPs and regions.
{% endhint %}

As a result, in our case, all users accessing the *[www.edgeport.info](http://www.edgeport.info)* address will be automatically redirected to the *edgeport.info* host.

You can also cancel this redirect at any time by selecting the **Remove The Redirect** option for the appropriate domain:

<figure><img src="https://539288051-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrAkU8kT3556pTePJXRV3%2Fuploads%2FrgIrQ4SSu48tR5C0Rz31%2Fimage6.png?alt=media" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Please **Note** that this change may take up to 5 minutes to be applied and up to 30 minutes to propagate fully across all PoPs and regions.
{% endhint %}
