The difference between a sub-domain and a sub-directory or folder

When your cPanel account is created it uses your primary domain e.g.

You'll notice there's nothing in front (e.g. www.) or behind (e.g. /blog) your domain name at this point.

Sub-domain - the part in front of the domain name

Within cPanel > Domains you'll see an option to add a Subdomain. This can be used to create separate copies of websites or installing specific software, like forums or a staging copy - useful for creating things like or

Once you've created a subdomain it will have its own web root folder and you can upload your site there.

Although www looks like a subdomain (and technically is) - this is often just a CNAME DNS record pointing at the domain.

Sub-directory - the part behind the domain name

You can create a folder or sub-directory within any web root folder (you can do this in cPanel File Manager).

For example, if your primary domain was and this website was being served from the public_html web root folder - if you create a sub-directory within public_html called blog and place web files where they could be viewed at

But, aren't subdomains just folders?

Yes, and no! When you create a subdomain cPanel creates a new subdirectory/folder within your web root - and this folder is where your web site files should be placed.

Because this folder is at your web root level - not under public_html - the files in it will only be accessible from the subdomain.

For example, if was your primary domain, served from /public_html you could create a sub-directory/folder called blog - web files here would be accessible at


you could also create a subdomain - and any files placed in this subdomains folder within web root would be accessible via

How did we do?

Powered by HelpDocs (opens in a new tab)
© Krystal Hosting Ltd 2002–