Subdomains
Subdomains let you create separate sections of your website under your existing domain, such as blog.yourdomain.com or shop.yourdomain.com.
What Is a Subdomain?
A subdomain is a prefix added to your domain name that points to a specific folder on your hosting account. Common uses include:
blog.yourdomain.com— A blog or news section.shop.yourdomain.com— An online store.staging.yourdomain.com— A staging or testing environment.support.yourdomain.com— A help desk or support portal.
Each subdomain has its own document root, so it can host entirely different content from your main site.
Creating a Subdomain
- Log into cPanel.
- In the Domains section, click Domains (or Subdomains on older cPanel versions).
- Click Create A New Domain.
- Enter the full subdomain (e.g.,
blog.yourdomain.com). - cPanel will auto-fill the document root. By default, this is
public_html/blog. You can change this to any directory you prefer. - Click Submit.
Uploading Content to a Subdomain
- Open File Manager in cPanel.
- Navigate to the subdomain's document root (e.g.,
public_html/blog). - Upload your website files. Place your homepage as
index.htmlorindex.php.
Managing Subdomains
To view and manage your subdomains:
- Go to Domains in cPanel.
- Your subdomains are listed alongside your other domains.
- Click Manage next to any subdomain to change its document root or configure redirects.
Removing a Subdomain
- Go to Domains in cPanel.
- Find the subdomain you want to remove.
- Click Manage, then click Remove Domain.
- Confirm the removal.
Wildcard Subdomains
A wildcard subdomain routes all unmatched subdomains to a single directory. This is useful for applications that generate subdomains dynamically (e.g., user1.yourdomain.com, user2.yourdomain.com).
To create a wildcard subdomain, enter * as the subdomain name. The document root should be the directory where your application handles the routing logic.