Creating a subdomain website in cPanel

A subdomain such as blog.example.com gives a project its own hostname. It can serve a separate application, but it still needs a hosting configuration, public DNS and a certificate if visitors will use HTTPS.

Check access and requirements

Choose the parent domain and decide whether the new site should have separate files. For a staging site, prepare authentication or another access restriction before publishing copied content. A subdomain is not automatically private just because it is called staging.

01 Create a subdomain website in cPanel

  1. Open Domains > Create a New Domain and enter the complete subdomain name, for example blog.example.com.
  2. Clear the shared document-root option for an independent site and choose a distinct folder. Review the generated path before submitting.
  3. Create the domain and upload or install the application into its displayed document root. Keep its database separate from production if it is a test copy.
  4. Create the subdomain’s DNS record wherever the parent zone is authoritative. If DNS is external, a record in cPanel alone will not make it public.
  5. Issue or include the hostname in SSL and set the application’s URL to the new HTTPS address.

Confirm the expected result

Check the hostname from a browser and verify that it serves the intended content rather than the parent site. Test links, assets and any login or form.

Why does the subdomain fail to resolve or show the parent website?

If the subdomain does not resolve, inspect authoritative DNS and any conflicting A, AAAA or CNAME record. If it shows the parent website, compare document roots and application settings. Remove temporary test files after the site is working.

Sources and further reading

  • 0 Users Found This Useful
  • cpanel-whm, domains-dns
Was this answer helpful?

Related Articles

Adding a domain alias that shares an existing cPanel website

A domain alias serves an existing website under an additional hostname. It is useful for a...

Removing a domain alias from cPanel

Removing an alias stops that hostname being configured as an additional entry to the website on...

Adding a separate website domain in cPanel

Add a separate website domain when another registered name should have its own files rather...

Removing a separate website domain from cPanel

Remove an additional hosted domain when its website is being retired or moved away. Removing...

Redirecting an additional cPanel domain to another website

Use a redirect when visitors to an additional domain should be sent to another URL. A redirect...