Skip to content
0850 554 5439 [email protected]

What do you need help with?

Search the guides and tutorials, or browse the categories.

Creating a subdomain in cPanel: opening a separate site such as blog.yourdomain.com

Shared Hosting 13 views Step-by-step guide Last verified: Markdown
What you will learnHow to open a separate site such as blog.ornekfirma.com under your main domain, which folder its files go into, how DNS and SSL are set up, and how to remove a subdomain safely.
Time5 minutes

1. What is a subdomain, and when do you use one?

A subdomain is a new address you create by adding a name in front of your main domain: blog.ornekfirma.com, magaza.ornekfirma.com, test.ornekfirma.com and so on. You don't buy a new domain; it's a separate site in the same hosting account, running from its own folder.

A subdomain is a separate site you open by adding a name in front of your main domain; it runs from its own folder.

Common uses:

  • A blog or shop separate from the main site.
  • A test site for trying a new design without breaking the live site.
  • A short-lived page for a campaign or event.
Info

If you want to add a completely different domain (for example gyroproje.com), see B18 — Adding an addon domain instead of this guide.

2. Open the Domains tool

  1. Log in to cPanel (client area → Services → your hosting service → Login to cPanel).
  2. On the home screen, open the Domains tool in the Domains group.
  3. Press Create A New Domain at the top right.
On the Domains page, press Create A New Domain at the top right.

3. Create the subdomain

On the Create a New Domain page:

  1. Leave Registered Domain selected under Select the type of domain to create.
  2. Type the full subdomain in the Domain box: magaza.ornekfirma.com.
  3. For subdomains, the Share document root box comes unticked and greyed out, so the subdomain shows content separate from the main site.
  4. Document Root (File System Location) fills in automatically (for example magaza.ornekfirma.com). This is the folder that will be created for the subdomain in your home directory. You can type a different name if you like.
  5. Press Submit.
Type the full subdomain in the Domain box; Document Root fills in automatically.
Warning

Don't leave Document Root empty and don't enter public_html, which is the main site's folder. Without a separate folder, the subdomain's files get mixed up with the main site's.

When it's done, the subdomain is added to the Domains list. The Document Root column shows the folder you upload its files to.

The subdomain is added to the list. The Document Root column shows the folder you upload its files to.

4. DNS, SSL and files

The DNS record

If your domain's nameservers point to the hosting (B13, Method 1), the subdomain's A record is added to Zone Editor automatically; there's nothing else to do.

If your nameservers point to the hosting, the subdomain's A record is added to Zone Editor automatically.

If your DNS is managed elsewhere (B13, Method 2; for example Gyro DNS or your registrar), add an A record for the subdomain there:

  • Name: magaza (some panels want magaza.ornekfirma.com)
  • Value: the Shared IP Address in the cPanel General Information box

For the steps to add records in Gyro DNS, see L09 — Gyro DNS record management.

SSL

Once the subdomain points to the server, the free SSL certificate is installed automatically by AutoSSL. You can follow it on the SSL/TLS Certificates → Status tab (B16).

Uploading files

  1. Open File Manager; you'll see the subdomain's folder in your home directory.
  2. Open the folder and upload your site's files there, with the home page as index.html or index.php (B14).
  3. If you're installing WordPress, choose the subdomain as the domain on the Softaculous install screen.
The subdomain's folder is created in your home directory; upload the site's files to this folder.

5. Check

  1. Open http://magaza.ornekfirma.com in a browser.
  2. If the page you uploaded appears, the subdomain works. If you haven't uploaded files yet, you may see an empty folder listing or a default page.
  3. After a few minutes, open it with https:// and check the padlock.

6. Changing or removing a subdomain

  1. In the Domains list, press Manage on the subdomain's row.
  2. To change its folder, enter the new folder in New Document Root and press Update.
  3. To remove it, use the Remove Domain button at the bottom of the page.
Warning

Remove Domain permanently removes the subdomain from your account and can't be undone. The files in its folder are not deleted; when you no longer need them, you can delete them separately in File Manager, or take a backup first (B20).

7. Troubleshooting

Symptom Likely cause Fix
"This domain already exists on this account" The subdomain already exists Search the list; choose a different name.
The subdomain doesn't open ("server not found") No DNS record If your DNS is elsewhere, add the A record; new records can take a while to propagate.
The main site opens instead The document root is set to public_html Give it a separate folder with Manage → New Document Root.
An empty list or "Index of /" No index.html / index.php in the folder Upload the files to the subdomain's folder.
"Not secure" warning with https:// The certificate isn't installed yet Check the Status tab described in B16.

8. Frequently asked questions

How many subdomains can I create?

As many as your plan allows. You can see your usage in the Statistics box on the cPanel home screen.

Does a subdomain cost extra?

No. A subdomain belongs to your main domain; you don't buy a new domain.

Can I create email addresses on a subdomain?

Yes. Use Create Email on its row in the Domains list, or choose the subdomain as the domain in the Email Accounts tool.

Does www.magaza.ornekfirma.com work too?

If your nameservers point to the hosting, cPanel adds the www record as well. If your DNS is elsewhere, you need to add a separate record for www.magaza.

Does a subdomain affect the main site's search ranking?

Search engines mostly treat a subdomain as a separate site. If you don't want a test site to show up in search, turn off search engine indexing in your site's settings.

Did you know?

To try a new design without breaking your live site, you can open a subdomain such as test.ornekfirma.com, work there first, and move the files to the main site's folder when you're ready.

Next steps

  • To add a different domain: B18 — Adding an addon domain.
  • See hosting plans: Web Hosting.
Was this helpful?

Thanks for your feedback!

Still Need Help?

The support team is here around the clock for anything you can't find in the knowledge base.