Home AZDIGI GuideHosting How to add an Alias Domain on cPanel

How to add an Alias Domain on cPanel

by Lê Quyền
Published: Last Updated on

What is Alias?

Alias, aka Parked domain, allows us to run a website on many different domains. An alias is a domain separate from the main domain but shares the same directory structure as the main domain.

  • Example: I have a domain called quyenlt.com, and I create an Alias called quyenlt.vn.

After setting up the alias, when you access either quyenlt.vn or quyenlt.com, you will receive the same content on both domains.

Step 1: Point the domain name to cPanel hosting

To make Aliases work successfully, you need to point that domain to the IP address of the hosting server so that the Alias becomes effective.

Step 2: How to configure an Alias

Firstly, log in to the cPanel management page and navigate to the DOMAINS section => click Create A New Domain as shown below:

CleanShot 2023 11 30 at 21.16.04@2x

  • For adding Aliases for the main domain, enter Domain Aliases => Submit as shown below:
CleanShot 2023 11 30 at 21.19.46@2x

  • For adding an Alias for an Addon Domain in the hosting, do the following:

For example, I have an Addon Domain called quyenlt.info, and I want to add quyenlt.org as an Alias for quyenlt.info:

CleanShot 2023 11 30 at 21.26.48@2x

Select Create A New Domain > Enter the Alias Domain > Uncheck the Share document root option > Enter the Document Root of the Alias Domain > Submit

CleanShot 2023 11 30 at 21.30.57@2x

Now you have successfully added the domain as an Alias. However, for WordPress source code, you must perform another step, step 3.

Step 3: Add configuration to the source code (specifically for WordPress source code)

After setting up the Alias, you need to add the following code to the wp-config.php file on the main website (main domain, the website to which the Alias is directed). If you don’t add this code, when users access the Alias domain, it will automatically redirect to the main domain, similar to the domain redirect feature.

define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']);
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']);


So we have learned how to add Alias Domains on cPanel. This practice will contribute to diversifying website access for customers more quickly using Alias Domains. We hope this article is helpful for you in the process of developing your website.

If you need assistance, you can contact support in the ways below:

Đánh giá

Tham gia nhóm hỗ trợ Server - Hosting

Tham gia nhóm Hỗ trợ Server - Hosting & WordPress để cùng nhau hỏi đáp và hỗ trợ các vấn đề về WordPress, tối ưu máy chủ/server.

Tham gia ngay

Bài viết cùng chuyên mục

AZDIGI – Không chỉ là đơn vị hàng đầu trong lĩnh vực Web Hosting và Máy chủ, chúng tôi mong muốn mang lại những kiến thức bổ ích nhất và luôn cập nhật thường xuyên cho cộng đồng người đam mê thiết kế website, công nghệ,…

Vui lòng không sao chép nội dung nếu chưa xin phép. Designed and Developed by PenciDesign