Discussions on this article:

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:

  1. index.htm
  2. index.html
  3. 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 this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

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

Question: Can't find index.html - "Website Coming Soon"

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
17,905 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
Staff
17,905 Points
2014-05-05 2:04 pm
Hello Gulf Safety,

Thanks or the comment. As per my earlier reply, some of the older accounts may have an index file, but any newly purchased account starts with a "default.htm". The article above refers to a "document root" which is set to PUBLIC_HTML by default. However, this can be changed as per our article: Changing the document root.

If you have any questions, let me know.
Arnel C.

Question: Can I change the document root?

n/a Points
2014-06-02 9:55 am

Can I change my document root?

Staff
10,406 Points
2014-06-02 10:17 am
Hello Ben,

Thank you for your comment. While it is not common, there are ways to change your document root; here is a link to our full guide.

If you are on a shared server, you would have to submit a ticket, and request that Live Support make the change for you.

If you have a VPS or Dedicated server, you can make the change with Root access.

Changing a primary domain's doc root is NEVER RECOMMENDED by InMotion Hosting. cPanel restores packages based on default settings and miss document root changes. So if the account is moved, the accounts with the doc root change may break.

If you have any further questions, feel free to post them below.
Thank you,

-John-Paul
n/a Points
2014-06-04 4:18 pm

In the past there was the option of uploading multiple images. It is no longer there. This is a huge inconvenience. Even if I were to upload them through ftp, there is no folder for the photo albums to place them in. This is one of my main uses for sharing religion and family events. Can the team make it so that at least through ftp, we can upload into album folders?

Staff
9,968 Points
2014-06-04 4:31 pm
Hello Jag,

You can use FTP to upload multiple images at once to the server.

For instance, on your desktop if you created a folder called my_images, and then inside that folder created another 3 folders called religion, family, and photos and then started placing images that fit into each of those categories into those folders. You could then simply connect with FTP to the server and upload the my_images folder from your desktop to the /public_html directory on the server.

You would then be able to access those images from your website, for instance if your website was example.com you would access those uploaded images at:

http://example.com/my_images/
http://example.com/my_images/religion
http://example.com/my_images/family
http://example.com/my_images/photos

Or you can just create the folders directly on the server via FTP that you'd like to move images into and upload multiple images that way too.

Please let us know if you have any further questions at all!

- Jacob
n/a Points
2014-08-01 3:45 am

How to ftp to my root directory?  I'm learning web development and I would like to know how to move my files/pictures to the root directory so people can see my webpage.  Also, would you please tell me if inmotion server support C++ script?

Thank you,

Staff
20,340 Points
2014-08-01 8:52 am
Hello Binh,

The root folder for your primary domain name is public_html. The root folder for any addon domain would be named after the domain and under the public_html folder. For example, if you had an addon domain for example.com the root folder would be public_html/example.com

As for the C++ scripts, they cannot run in the default server setup, but can be set up if you have root access on a VPS or Dedicated server.

Kindest Regards,
Scott M
n/a Points
2014-08-01 7:20 pm
PHP isn't working for the subdomain I created.
Staff
10,406 Points
2014-09-03 8:38 am
Hello Joseph,

Thank you for contacting us. We are happy to help, but will need some additional information.

What is happening, are you getting any errors?

Is this a new subdomain? Keep in mind newly created domains/subdomains can take up to 24 hours to propagate.

Is the domain name pointed to our nameservers? If not, you must create the subdomain where your DNS is hosted, and point it to your shared IP.

If you have any further question, feel free to post them below.
Thank you,
John-Paul
2014-09-25 2:15 am
Hello,
I need some favour, actually I have uploaded my website on server.but it is in .net architecture.It all contains .aspx pages not .html. I uploaded that but these pages are showing code on my website.what shouls I have to do?
Staff
20,340 Points
2014-09-25 9:02 am
Hello,

Microsoft specific pages like asp will only work on servers that are Windows based or after extensive modification to be able to do so. Our servers do not work with Windows products as they are Linux based.

Kindest Regards,
Scott M
n/a Points
2014-08-22 9:20 pm
Too early for me to judge. Wait till I upload my site folders and files and then I willl know whether you are better than godaddy. If so, I will consider moving my other sites from godaddy to inmotion.
Staff
10,406 Points
2014-09-03 8:52 am
Hello Joseph,

Thank you for your feedback. Our guide on moving your websiteto InMotion Hosting may help with your transfer.

Also keep in mind Live Support is available 24/7 365 days a year, and we are located in Virginia Beach.

If you have any further questions, feel free to post them below.
Thanks,

John-Paul
n/a Points
2014-09-02 11:44 pm

Hi everyone,

I've been searching for couple days and really fraustrated and did could not found the answer I am looking for. I have a small web application which uses php, javascript, jquery, and html. the only file the user is supposed to see is html file. java script and jquery are the only files communicating with php script (sending data over and receiving data). Therefore, I don't want to place my php file inside htdocs and I rather put it in cgi-bin. But my problem is when I place them in any folder before htdocs, it does not work. for example: if my html file is in htdocs and i leave my files in htdocs/bin/myJsfile.js , myPhp.php , it works.

I'm using apache 2.2 and I'm sure I have the correct permisson for cgi-bing which is 755. Overall, the only reason for me to do that is because if the user opens up my js file from page source view, they can see what is the name of php file it's communicating with which can be very harmful. The reason is if the user search for example: localhost/myphp.php, it means they can have access to that actual file, regardless of they wont see the code. 

Is there anyway I can place and read php file on cgi-bin?

I appreciate if someone help me with that.

Cheers,

Staff
10,406 Points
2014-09-03 1:42 pm
Hello Mors,

Thank you for your question. As long as your user has permission to the .js, and .php file, you should be able to access it via absolute path.

If you have any further questions, please feel free to post them below.

Thank you,
John-Paul
n/a Points
2014-09-03 2:19 am

How to fix the php issue? I won't execute the simple phpinfo().

Staff
10,406 Points
2014-09-03 9:02 am
Hello,

Thank you for contacting us today. After creating a phpinfo page, you should be able to see your PHP settings right away.

If it is not, we are happy to help, but will need some additional information.

What happens when you go to your phpinfo page? Are you getting any errors? What are the errors?

Can you provide a link to the page you are creating, so we can test the problem?

Thank you,

John-Paul
n/a Points
2014-09-03 8:23 am

information for code development sharing......

n/a Points
2014-09-07 12:58 pm

Hello Team,

I am facing one problem in my magento website.

I have a email newsletter which have some images to show. 

My problem is to access the images outside the website. For example, when i typed the url/path of images paced in website, it shows 404 error, because magento think this is a some page name(which is not actually).

I just want to access those images. For example example.com/newsletter_images/offer.jpg

Guys, please help. I am stucked in this.

 

Thanks in advance

-Amrinder

Staff
20,340 Points
2014-09-08 9:34 am
Hello Amrinder,

You may want to make this a new question under the Magento category.

By the basic description, we would not be able to give any advice. Do you have a specific link to an image in your newsletter you can share so we can check? Also, if you are a customer, we are able to assist by checking files and folders in the account for things such as permissions, or hotlink protection, etc.

Kindest Regards,
Scott M

n/a Points
2014-09-13 3:55 pm
article is fine, just not what I need. I cannot find my WP pages (dozens of them) via ftp
Staff
20,340 Points
2014-09-15 10:09 am
Hello Jonathan,

Word press posts do not exist in the account as files. Each post, page, etc is created at the time it is clicked by the server. The data for each post/page is kept in the wordpress database.

Kindest Regards,
Scott M
n/a Points
2014-09-16 7:12 am

hi everybody i got an issue in php,i have uploaded a php code webpage to my server, but when i click on that anchor tag, i am getting a error message obviously its not a error message, i am getting The System cannot find the path specified.

i am using godaddy server

Staff
20,340 Points
2014-09-16 9:15 am
Hello Prabudass,

That type of error means that the server was told to look at a specific folder path. If it looks for that path but cannot find one or more elements of the path (folder or file) then it will throw that error. Check the code and any paths mentioned in it and then look to ensure that the exact same path exists in your hosting account.


For example: if the code needs a path of 'abc/123/xyz.php' but the server only has 'abc/xyz.php' then the error will occur because it cannot find the '123' directory.

Kindest Regards,
Scott M
n/a Points
2014-09-18 6:52 am

hi,

just now i uploaded my php script page to my live server (free hosting site), its works fine but when i upload the same page to my paid server godaddy its says the system cannot find the path specified.

Staff
10,406 Points
2014-09-18 9:50 am
Hello prabudass,

Thank you for your question. I recommend checking the specified path in the script, and make sure it is correct with Godaddy's file structure.

I tried to find a guide in Godaddy's Support site, but could not find anything helpful. You may want to reach out to them via ticket or phone support.

If you have any further questions, feel free to post them below.

Thank you,
John-Paul
n/a Points
2014-10-27 6:20 pm

i am using hosting and domain with hostgator.com and designing web in prestashop 1.6 now i want to upload my product catalog in my webpage in pdf format. so that my customers can directly download from my web page or can i creat any link that can be uploaded in my web page so that i can send my customer that link to download from my web

Staff
10,406 Points
2014-11-20 1:16 pm
Hello PARRY,

Thank you for contacting us. You will have to create the pdf yourself, or use a 3rd party Addon such as Export PDF Catalog 1.5 - PS 1.5 & 1.6 Module.

can add the pdf as a downloadable product in PrestaShop, and set the price to free.

Thank you,
John-Paul
n/a Points
2014-11-20 1:04 am

Good day,I purchased a template from ThemeForest for my OpenCart website. I read your tutorials and downloaded Filezilla. It is my first time using FTP. Everything is a-okay so far and I managed to quickconnect without a sweat. I have already extracted the template into a folder on my desktop. I have two questions: 1. I would like to know where exactly in 'Remote Site' I should drag the template files. Do I put them directly in public_html or do I create a sub-folder in public_html? Is there a more appropriate folder to put website template files?2. How do I then run the template so it takes effect on my new site. Usually, if I download a software, I can always look for the .exe and double-click that to run an application. Template files don't seem to work like that and use unknown extensions such as .sh, .sql. What should I double-click to make my template work?I wouldreally appreciate your assistance!Cheers,William

Staff
10,406 Points
2014-11-20 12:38 pm
Hello William,

Thank you for contacting us. I recommend following our walk-through guide on Installing an OpenCart theme.

It explains where to upload the files to (the root of your OpenCart installation), and how to install the theme .
Thank you,
John-Paul
n/a Points
2014-11-20 1:11 pm

Thank you John-Paul,This is exactly what I needed. I will try it afterwork tonight!Cheers,William

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

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

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!