A subdomain is an extension of your main domain, allowing you to create separate sections or services under your existing domain name. With cPanel, you can easily create subdomains to host different parts of your website, such as blogs, online stores, or development environments. Subdomains operate independently, meaning you can assign different files, directories, or applications to each one.
Adding a subdomain in cPanel is a straightforward process. Once created, the subdomain can be accessed via a unique URL (e.g., blog.example.com) and can have its own directory structure. Additionally, you can configure specific DNS records for each subdomain, providing flexibility for hosting multiple services under the same main domain.
Before creating a subdomain, ensure that you have a clear directory structure in mind and that your web hosting plan supports multiple subdomains. The number of subdomains you can create may depend on your hosting provider.
Steps to create a subdomain in cPanel:
- Log in to your cPanel account.
- Navigate to the Domains section.
- Click on Subdomains.
The Subdomains interface allows you to create and manage subdomains under your main domain.
- In the Create a Subdomain field, enter the name of the subdomain (e.g., blog, shop).
- Choose the main domain from the dropdown list.
The main domain must already be configured in cPanel for the subdomain to be created. For example, if your domain is example.com, and you want to create blog.example.com, select “example.com” from the dropdown.
- The Document Root field will automatically populate with the subdomain directory. You can change this if you want to specify a different directory.
The Document Root defines where the files for the subdomain will be stored. For example, the directory for blog.example.com might be “/public_html/blog/”.
Example subdomain configuration: Subdomain: blog Domain: example.com Document Root: /public_html/blog/
- Click Create to add the subdomain.
Once created, the subdomain will be accessible via a unique URL (e.g., blog.example.com). You can also manage DNS records for this subdomain via the Zone Editor.
- Verify that the subdomain has been successfully created by navigating to its URL in a browser.
Mohd Shakir Zakaria is an experienced cloud architect with a strong development and open-source advocacy background. He boasts multiple certifications in AWS, Red Hat, VMware, ITIL, and Linux, underscoring his expertise in cloud architecture and system administration.
Comment anonymously. Login not required.