-->

Last updated:

An alias is a domain that shows the content of another domain. If you own multiple domains, such as example.net and example.com, and you want both domains to display the exact same content then you can achieve that by creating an alias.

cPanel’s Aliases interface has two sections:

  • At the top of the page you can create an alias.
  • At the bottom of the page you can see (and remove) existing aliases.

Creating a new alias

To illustrate how to create and manage aliases, let’s imagine you got a cPanel account for the domain example.net. You also own the domain example.com, and you want that to be an alias of the main website. To create the alias, simply enter the domain and hit the Add Domain button.

Creating the alias 'example.com'.
Image: creating the alias ‘example.com’.


Note: An alias only works if the A record for the alias points to the IP address of the server that is hosting the main domain. In other words, the DNS for the parked domain needs to be set up correctly.


Manage aliases

Aliases you create are shown under the – slightly misleading – header Remove Aliases. The reason the header isn’t quite accurate is that you can do more than just deleting aliases:

  • Clicking domain root opens the directory shown in cPanel’s file manager.
  • The Remove link deletes the alias.
  • The Manage Redirection link lets you set up a redirect.

Managing existing aliases in cPanel.
Image: the ‘Remove Aliases’ section.

Redirecting an alias

Our example.com alias shows the content of example.net. So far, so good. But… in the bottom-left corner of the below image you see that clicking the Contact link takes you to example.net/contact rather than example.com/contact. It will show the correct content, but users are suddenly taken to a different domain.

A screenshot of the website example.net, viewed via the domain example.com.
Image: the alias ‘example.com’ is showing the content of ‘example.net’.

The reason is that the link is an absolute URL. If the URL was a relative URL (that is, a link that doesn’t specifying the domain) then it would point to example.com/content instead. This is one of many reasons why it is best to always use relative links to link to pages on your website.

Aliases and SEO

Also, if you care about search engine rankings then having more than one domain showing the exact same content is not recommended. Although nobody really knows how the likes of Google rank websites it may be that you get penalised for having more than one domain with the exact same content.

If any of the above is a concern then it makes sense to add a redirect for the alias. A redirect tells browsers that the domain example.com lives at example.net. In other words, people still see the content of example.net when they visit example.com, but this time the URL shown in the browser’s address bar is changed to example.net.

Creating a redirect for an alias

You can create a redirect for an alias by clicking the Manage Redirection link. This takes you to the Alias Redirection page. On that page you only need to enter the destination domain.

Redirecting the alias 'example.com' to 'example.net'.
Image: creating a redirect for an alias in cPanel.

A word of caution about cPanel redirects

The redirect is created by adding a rewrite rule to the main .htaccess file. You can view the file via cPanel’s file manager (make sure that Show Hidden Files is ticked in the file manager’s settings). The rule that is created looks like this:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.com$
RewriteRule ^/?$ "http\:\/\/example\.net" [R=301,L]

It is great that cPanel can add (and remove) complicated rules like this. However, there is a small risk that new redirect rules break your website. Always check your website after adding a redirect, and submit a ticket if you notice any mysterious redirection issues.

Temporary URL alias

There is another use of aliases: you can use an alias to view a website on a specific server, even if the DNS for the domain is pointing to another server.

Let’s say that you are moving the website example.net from another company to us. The new hosting package is on our Strawberry server but the DNS is still pointing to the old provider. If you want to be able to work on the new website without pointing the DNS to the new server then you can do so via an alias.

There are other ways to view a website on a specific server without changing the DNS. Often, using an alias is the easiest method. Please send us an email if you want a temporary URL / alias for your website.