Steps to Add Subdomain in cPanel. To direct visitors to a directory on your website, use a subdomain. Consider the case where your website has a user-only area and the files are located in /public html/users. The user’s area would be accessible at https://example.com/users/. 

Advertisement

When you create a subdomain, you can use the URL https://users.example.com. Both URLs lead to the same files. The subdomain gives you another URL option.

I’ll demonstrate how to create or add a subdomain in cPanel in this article. Along with when to use and when not to use a subdomain.

Advertisement

What Is a Subdomain?

A name that is a part of your primary domain is known as a subdomain. When a part of a website URL appears before the main domain, that is a sign of a subdomain. In the aforementioned illustration, the main domain is “example.com”, and the subdomain is “users.example.com”.

Typically, subdomains are used to signify a different area of a website or, in some situations, a whole different website.

Advertisement

An A record is added to the DNS zone of your domain when a subdomain is created. On the web server, a configuration file is also added in order for the server to know where to send traffic from the subdomain.

How to Create a Subdomain

Log in to cPanel.

In the “Domains” section, click the “Subdomains” link or icon.

Steps to Add Subdomain in cPanel

Advertisement

In the “Subdomain” field, enter the name of your subdomain. That’s the section that precedes the main domain

If you have multiple domains in your cPanel account, choose the domain on which you wish to create a subdomain from “Domain” drop-down.

Advertisement

The “Document Root” is the root directory for the subdomain.

Steps to Add Subdomain in cPanel

Click the “Create” button.

When the subdomain has been created, you will see a success message.

Within five to ten minutes, you should be able to view the subdomain. It can take some time for the new DNS record to propagate across the internet because you are doing a DNS update. Propagation usually ends after an hour or two.

Advertisement

This is why if you create a subdomain and then immediately install something like WordPress, you can receive a 404 page. A 404 not found error could appear if you attempt to access the website shortly after creating the subdomain.

Just wait a little while before attempting to access the subdomain.

Creating a Wildcard Subdomain

If you want to point any subdomain of your domain name to a specific directory on your website, you use a wildcard subdomain.

Advertisement

When you create a wildcard domain, any subdomain prefix typed before your domain will lead to the subdomain root directory. So erp.example.com, erp9.example.com and demo.example.com could all lead to the same directory on the site.

To create a wildcard domain, use the same method detailed above, but enter * in the “Subdomain” field.

Advertisement

Depending on your host, creating a wildcard subdomain may involve manual DNS zone editing. Take a look at this cPanel article for more details.

When You Should Use a Subdomain

The most frequent usage of a subdomain is when a website has a portion that is distinct from the main site. like a blog, forum, control panel, users-only area, and so forth.

Similarly, different regional or language versions of the same website use subdomains. For instance, take the websites english.example.com and french.example.com

Advertisement

Subdomains are often used as private spaces within larger communities or social networking sites. Username.example.com could be a user’s subdomain on example.com.

It is a matter of personal preference whether or not to use a subdomain for the majority of smaller or personal websites. It really is just a matter of preference because the destination is the same whether you use a subdomain or the /directory URL.

When You Should Not Use a Subdomain

Advertisement

There are a few things to think about before creating a subdomain, even though using one is a matter of personal opinion. Maintenance is one. If you use subdomains and decide it’s time to switch hosts, the transfer will need more configuration effort.

Subdomains impact how search engines see your website, which is perhaps more significant. A subdomain is a distinct website in Google’s perspective. It is believed that the traffic to blog.example.com is distinct from the traffic to example.com.

Advertisement

Are you more or less likely to create a subdomain for your website now that you know more about creating and using them? Do you worry about how search engines evaluate your website if you currently use subdomains?

Leave a comment

Your email address will not be published. Required fields are marked *