If you need to upload files to your hosting account, you will need to know to which directory to upload them. The specific directory you will upload them to will depend on whether you are working with the main domain, an addon domain, or a sub domain. In this guide, we discuss how to determine which folder to work with.

Finding the Document Root

A domain's document root, also known as the home folder, is the main folder that contains all of the files for either a domain or a subdomain.

Main Domain
The document root for your main domain name is your public_html folder. This means when someone visits your main domain, the server returns files that are located in the public_html folder.

Subdomains
The document root for a subdomain is a bit different. If your subdomain is http://store.example.com, then the document root folder would be public_html/store.

Addon Domains
Addon domain document roots are very similar to subdomains. If there is an addon domain on your account, the main folder is also under the public_html folder. For example, if you have an addon domain named http://example2.com on your account, the document root would be public_html/example2.com. Below is a charted explanation as well.

Default document root structure

The path to the specific folder within your account will differ depending on whether it is the main domain, a subdomain, or an addon domain. Below is a quick table guide to help you understand how they work.

Domain typeURL pathFile Structure
Main domainhttp://example.compublic_html
Subdomainhttp://store.example.compublic_html/store
Addon domainhttp://example2.compublic_html/example2.com

How do I find the document root of an addon / sub domain?

If you are unsure of the document root folder for an addon or a subdomain because you did not go with the defaults, you can find it by using the following steps.

Finding an addon document root

  1. Log into cPanel
  2. Click the Addon domains icon
  3. You will see a list of addon domains configured in your account, the document root will be listed here.

Finding a sub domain's document root

  1. Log into cPanel
  2. Click the sub domains icon
  3. You will see a list of addon domains configured in your account, the document root will be listed here.

What file loads first?

If no particular file is specified, the directory index file will be the first file the server loads from a folder. For example, if you type in example.com/contact_us.php, the server will return the contact_us.php page. If you type in simply example.com, the server will load the directory's index file. The server looks for these specific files in the following order: index.htm, index.html, and index.php. If the server does not find any of these files, it will display a default screen with a list of the files in the folder as shown to the right. This can be a security risk so you always want to ensure that a file will be served instead.

Can I change the directory index file?

Some website design applications will name the home page something other than the standard index.htm, index.html or index.php. For example, the application may name your homepage Welcome.html, Home.html, or even something. If your application does this, you will need to modify your .htaccess file and set your Directory Index setting to match that of website's first page.

How do I change the directory index?

To change your directory index, edit your .htaccess file and add the following line:

DirectoryIndex some-file.html

For example:
Let's assume that the homepage for your website is named Welcome.html. We need to update the .htaccess file so that the server knows to load Welcome.html first, instead of index.htm. Open (or create) the .htaccess file in your domain's document root and add the following line:

DirectoryIndex Welcome.html

Yes, it is that easy! Please note that the server is case sensitive, so be sure to use the proper case. For example, Welcome.html is different than welcome.html.

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve our Support Center:
Email Address
Optional, but our team may contact you for more information.
Like this Article?

Comments

Post a comment
2013-01-28 9:17 pm
You say in this article to delete InMotion's index.html file and we shouldn't see the "Website Coming Soon" page. I can't find that file. Where is it located?
Staff
10,559 Points
2013-01-28 9:20 pm
Hello Tmgiles6,

If your account is fairly recent you will NOT see the INDEX.HTML file. They have removed it and only the default.html file exists now. If you place any type of index file into the public_html folder, it will automatically become the primary index file.

This article was written for older accounts that have the INDEX.HTML file within the public_html folder. Our apologies for any confusion. I will update the article with a note shortly.


If you have any further questions, please contact technical support or leave a comment at the bottom of the page.

Regards,

Arnel C.
2013-02-20 4:38 am
This article was written for older accounts that have the INDEX.HTML file within the public_html folder. Our apologies for any confusion. I will update the article with a note shortly.

Gulf Safety Equips Trading LLC

Post a Comment

Name:
Email Address:
Comment:
Are you a bot?
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

Write New!
Do you want to publish a tutorial to our support center?

News / Announcements

SSL Certficate Warnings
Updated 2014-04-14 11:34 am EST
Hits: 2164
Heartbleed 0-day OpenSSL security bug
Updated 2014-04-14 04:43 pm EST
Hits: 5550

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!