When you are thinking of uploading a file to your hosting account, first you have to know the details of the directory where you have to upload them. It is all about in which domain you are working with. It depends on whether you are working with the main domain , sub domain or addon domain. The specific directory will upload the files according to the domains. This quick tutorial helps you to determine the document root of your website.

DOCUMENT ROOTS

Main domain

Your public_html folder is the document root for your main domain. When you have a visitor to your main domain, the server returns files located in the already mentioned public_html folder.

Subdomains 

The subdomain is the one under main domain. The document root for this is bit different. If we have a subdomain as https://servers.webnexs.com , then the document root folder will be public_html/servers.

Addon domains

Addon domains are actually the same as the subdomains. For finding the addon domain on your account, you have to look at >cPanel Addon domains section for finding the exact location where the root folder has been set. For the url https://servers.webnexs.com/ , the file structure will be  as add_on_domains/servers.com.

FINDING THE DOCUMENT ROOTS OF SUBDOMAIN AND ADDON DOMAINS

Addon domain

We provide you simple steps if you are unsure of the document root of addon domain. Use this shortcut.

1 step    : Log in to cPanel

2 step   : Select Addon domain option

3 step   : You will see the list of addon domains in your account. Next to that you will see the document root.

Subdomain

We provide you simple steps if you are unsure of the document root of subdomain domain. This is similar to what you have done to addon domain.

1 step    : Log in to cPanel

2 step   : Select Subdomain domain option

3 step   :You will see the list of subdomains  in your account. Next to that you will see the document root.

CHANGING THE DIRECTORY INDEX FILE

When you see your names of the home page other than the standard index.htm or index.html or index.php , the directory names need yo be modified. For this, you have to modify your .htaccessfile and later set your  setting of directory index like matching the first page of the website.

How to change the directory index file?

1 step               :   As said before, you have to modify your .htaccessfile .

2 step               :  Add DirectoryIndex some-file.html

Note: The server is case sensitive. So be sure that you use the proper cases while changing the directory.