Learn how to create and manage subdomains within your cPanel interface. Understand the difference between domains, subdomains, and alias domains. Follow step-by-step instructions and enhance your website's structure and functionality.

Understanding Domains, Subdomains, and Alias Domains:

Imagine your website as a bustling city. A single domain name is like the main town square, but what if you needed dedicated areas for specific purposes? Subdomains act like distinct districts within your website, allowing you to categorize content and create unique online experiences. This guide will equip you, the website owner, with the know-how to create and manage subdomains within your WebHostingM cPanel interface.

  • Domain: A domain is a unique address that identifies a website on the internet, such as example.com. It's the foundation upon which your entire online presence is built.
  • Subdomain: A subdomain is a subsection of a domain that can function independently. Think of a subdomain as a prefix added to your domain name, creating a subsection. It typically precedes the main domain name, such as blog.example.com.
  • Alias Domain: An alias domain acts like a signpost, redirecting visitors from another domain name to your main domain or a subdomain.

 

Why Create and Use Subdomains

  • Organization: Subdomains help compartmentalize your website's content. Subdomains allow you to organize content within your website effectively. For example, you can create subdomains for blog posts, forums, or support pages.
  • Marketing and Branding: Subdomains offer flexibility for marketing campaigns or creating microsites with a distinct brand identity.
  • Targeted Audiences: Subdomains can cater to specific visitor groups. A forum subdomain ("forum.example.com") could attract a more engaged community.
  • Functionality: You can use subdomains to host separate applications or services, such as a store or a blog, without affecting the main website's functionality.

 

How To Create a Subdomain in cPanel

How To Create A Subdomain In cPanel Step 1

 

  1. Accessing Domain Management:

    • Log in to your cPanel hosting panel. his is your control panel for managing your website and hosting.
    • Scroll down to the "Domains" section and click on the "Create a New Domain" icon. Look for icons or menus related to domain management. If you have several domains, you will the list of all your domains. Select the domain you are creating the "sub" for.

 

  1. Creating a Subdomain:

    How To Create A Subdomain In cPanel Step

     

    • Enter the desired subdomain you want to use before your main domain (e.g., "shop.example.com") in the "Domain" text box to create a subdomain of shop.example.com..
    • If you want the document root (the Document Root defines the directory where the subdomain's files will be stored relative to your account's home directory.) to serve the same content as “example.com”, then tick the Share document root (/home/hostdragon/public_html) with “example.com” checkbox. To create a unique directory for the subdomain to serve different contents, deselect the Share document root with "example.com" checkbox, where example.com represents your main domain.
    • Note: The Document Root defines the directory where the subdomain's files will be stored relative to your account's home directory.
  2. Directory Restrictions:

    • Certain directories cannot be used as a document root, such as system directories and special folders such as:
      .cpanel, .trash, etc, mail, ssl,tmp, logs, .cphorde, .spamassassin, .htpasswds, var. cgi-bin, .ssh, or perl5
  3. To automatically redirect the new domain's visitors from the insecure version of the website to the secure version, set the Force HTTPS Redirect toggle to On.

  4. Completing the Process:

    • Click on the "Submit" button to finalize the creation of your subdomain. Or use the "Create Another Domain" to create another subdomain.

 

Using cPanel API To Create Subdomains (Advanced Users Method):

For advanced users comfortable with the command line, follow the command below to create a subdomain:

uapi --output=jsonpretty SubDomain addsubdomain domain='subdomain' rootdomain='example.com'

Managing Subdomains:

  • File Manager Access/Management: To manage the subdomain's document root directory, remove the domain, or perform redirect or other actions, click on "Manage" on the list of domains.

  • SSL Certificates: When you create a new domain or subdomain, the system will attempt to secure it with the best available certificate. If AutoSSL is enabled, it will automatically request and install a certificate for the new domain.

  • Remove the domain:

    • Caution: Proceed with care! Removing a subdomain permanently deletes its configuration from cPanel.
    • To remove a subdomain, click "Remove Domain" next to the desired subdomain.
    • cPanel will prompt you for confirmation. Click "Yes, remove this domain" only if you're absolutely sure.

 

Important Considerations Before Removal

  • Backup First: We highly recommend creating a full cPanel backup before removing a subdomain. This ensures you can restore it if needed. Refer to your WebHostingM documentation for backup instructions.
  • Data Retention: Removing a subdomain only affects its cPanel configuration and DNS entries. The actual files and folders associated with the subdomain will remain on the server until you manually delete them.
  • Main Domain Locked: You cannot remove your main domain through this process.

 

WebHostingM Support

Remember: If you're a WebHostingM customer and ever feel overwhelmed by the command line, don't hesitate! Submit a ticket and our friendly engineers will be happy to assist you.

Not a WebHostingM customer yet, but curious about the power of cPanel? WebHostingM offers fantastic cPanel hosting plans – check them out at https://mydashboard.webhostingm.com/store/cpanel and unlock a world of website management possibilities!

Did this answer help? 0 People found this helpful (0 Votes)