Overview
An addon domain is an additional domain to be hosted in the same cPanel account, usually a separate website owned, controlled, or managed by the same client as the primary domain. Addon domains can be related to the primary domain, but they do not have to be. Addon domains can have different TLDs, extensions, registrars, or virtually any other setting, and still be hosted within a single cPanel account in addition to the primary domain.
A subdomain is a subsection of your website, usually intended to provide a more specific purpose than the main site. Subdomains use the structure of a prefix “dot” domain name. For example, if the registered domain name is cozaq.com, the subdomain will be prefix.cozaq.com. You can use subdomains to create unique user accounts for “vanity domains.” This is helpful if, for example, you have a blog, or any other type of website that uses a domain specifically titled for a user.
In cPanel, both addon domain and subdomain files usually exist as a subdirectory of your public_html directory or your account's home directory. The exact location used is configurable by the user when the subdomain is added to cPanel.
Before we get into adding, modifying, or removing addon domains or subdomains, there is an administrative setting that should be understood first as this setting directly affects the ability to control the location of files for these new “secondary” domains. Please see our Understanding WHM’s Domain Root Restriction Setting companion article for more details.
Managing Addon Domains
Since the process and options available for managing Addon Domains is nearly identical to those for managing Subdomains, the steps detailed below work for both addon domains or subdomains.
Creating a Subdomain
To create a subdomain, perform the following steps:
- Log into your cPanel account
- Under Domains click the Subdomains icon.
- Enter the desired prefix in the Subdomain text box and select the desired main domain from the menu.
- Enter the home directory for the subdomain in the Document Root text box.
Notes:- The house icon represents the cPanel account's home directory. The Document Root text box defines the new subdomain's directory, relative to the cPanel account's home directory.
- If you wish the subdomain to use the files within public_html itself, enter a single forward-slash ( / ) in the Document Root folder entry field as shown here:
- cPanel will automatically create a new empty folder for the new set location if the new folder does not exist.
- Click Create.
Modifying a Subdomain
Modifying the Document Root for a Subdomain
To modify the document root for a subdomain, perform the following steps:
- Click the pencil icon (
) that corresponds to the subdomain that you want to manage.
- Enter the new file path that you want to use as the Document Root in the available text box.
- Click Change.
Note: This modification changes the location where cPanel looks for files for this subdomain. It does not rename or delete the old folder that was set prior to making this change, but it will create a new empty folder for the new setting if the new folder does not exist.
Enable or Disable Subdomain Redirection
To enable or disable redirection of a subdomain, perform the following steps:
- Click the Manage Redirection link that corresponds to the subdomain that you wish to manage.
- If you wish to redirect the subdomain, enter the link to which you want to redirect the subdomain in the available text box.
- Click Save.
- To disable the redirect, click Disable Redirection.
Remove a Subdomain
To remove an existing subdomain, perform the following steps:
- Click the Remove link that corresponds to the subdomain that you want to remove.
- Click Yes to confirm that you want to remove the subdomain.
Note: This modification does not rename or delete the old folder that was set prior to making this change.