Subdomains

Overview

This interface allows you to create and manage subdomains for your cPanel account. A subdomain is a subsection of your website that sometimes exists as a subdirectory of your public_html (document root) directory or your account’s home directory. Subdomains use a prefix in conjunction with the domain name.

For example, if the registered domain name is example.com, the subdomain will be prefix.example.com. You can use subdomains to create unique user accounts for vanity domains.

Note:
Visitors cannot view your subdomain immediately. Changes to DNS records may require two days or more to reach all of the nameservers on the Internet.

Create a subdomain

Warning:
Due to the order in which Apache processes its configuration file, wildcard subdomains may disrupt the functionality of service subdomains. We strongly recommend that you use wildcard subdomains only when absolutely necessary, or when you do not need to use service subdomains.

To create a subdomain, perform the following steps:

  1. Enter the desired prefix in the Subdomain text box.

  2. Select the desired main domain from the menu.

  3. Enter the home directory for the subdomain in the Document Root text box.

    Note:
    • 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. For example, if you enter subdomain in the Directory text box and the cPanel account uses the /home/example home directory, the subdomain will exist in the /home/example/subdomain.example.com/ directory.

      • The system automatically populates this text box with the subdomain’s fully-qualified domain name (FQDN).

      • You cannot use the following directories as a document root:

     
    • The account’s home directory itself ( / )

      • Directories outside of the account’s home directory ( ./ and ../ )
      • .cpanel
      • .trash
      • etc
      • mail
      • ssl
      • tmp
      • logs
      • .cphorde
      • .spamassassin
      • .htpasswds
      • var
      • cgi-bin
      • .ssh
      • perl5

     

  4. Click Create.

When you create an addon domain, parked domain, subdomain, or main domain, the system will attempt to automatically secure that domain with the best-available existing certificate. If no certificate exists, the system will generate a self-signed certificate to secure the new domain.

  • If AutoSSL is enabled for the account that owns the new domain, the system will add a request for an AutoSSL certificate to secure the new domain and install it when it becomes available.

  • To open the subdomain’s main directory with the File Manager interface (cPanel >> Home >> Files >> File Manager), click the link under Document Root that corresponds to that subdomain.

Search subdomains

To search existing subdomains, perform the following steps:

  1. Enter the search criteria in the Search text box.

  2. Click Go.

Modify a subdomain

Modify the document root for a subdomain

To modify the document root for a subdomain, perform the following steps:

  1. Click the notepad icon that corresponds to the subdomain that you want to manage.

  2. Enter the new file path that you want to use as the document root in the available text box.

    Note:

    You cannot use the following directories as a document root:

    • The account’s home directory itself ( / )

    • Directories outside of the account’s home directory ( ./ and ../ )

    • .cpanel

    • .trash

    • etc

    • mail

    • ssl

    • tmp

    • logs

    • .cphorde

    • .spamassassin

    • .htpasswds

    • var

    • cgi-bin

    • .ssh

    • perl5

     

  3. Click Change.

Enable or disable subdomain redirection

To enable or disable redirection of a subdomain, perform the following steps:

  1. Click the Manage Redirection link that corresponds to the subdomain that you wish to manage.

  2. If you wish to redirect the subdomain, enter the link to which you want to redirect the subdomain in the available text box.

  3. Click Save.

  4. To disable the redirect, click Disable Redirection.

Remove a subdomain

To remove an existing subdomain, perform the following steps:

  1. Click the Remove link that corresponds to the subdomain that you want to remove.

  2. Click Yes to confirm that you want to remove the subdomain.

  3. To keep the subdomain, click No.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Addon Domains

Overview Addon domains allow you to control multiple domains from a single account. An addon...

Aliases

Overview Domain aliases are domains that you own, but which do not contain any content. Instead,...

Domains

  Overview Use this interface to create and manage multiple domains from a single cPanel...

Dynamic DNS

Overview Use this interface to simplify access to networks that use a dynamic IP address. A...

Redirects

Overview The Redirects interface allows you to send all of the visitors of a domain or...