What directory should I put my files in?

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 subdomain. 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 domain http://example.com public_html
Subdomain http://store.example.com public_html/store
Addon domain http://example2.com public_html/example2.com

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.

  • root, document, upload, files, directory, public
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Getting Started: FTP

 Example Hostname domain.com Username cPanel Username (For example: userna99)...

Install Other Software

Softaculous is a tool located within your cPanel you can use to help you easily install other...

Uninstall Software

Uninstalling programs with Softaculous: Log into your cPanel Under the Software/Services...

Website Security - Preventative Measures

Backing up your account We're starting this article on website security with an introduction to...

Affiliate Programs: Tips to make money with Luna Web Space

Tip 1: Share your affiliate link on social media. When you register for an affiliate, a link is...

Powered by WHMCompleteSolution