The document root is the main folder where your website files are stored.
Only files inside the document root are accessible through your domain in a browser.
Understanding the document root is essential for uploading and managing websites correctly.
What the Document Root Does #
The document root:
- Defines where the website starts
- Maps a domain to a specific folder
- Controls which files are publicly accessible
When someone visits your domain, the server loads files from this folder.
Common Document Root Locations #
Typical document root locations include:
public_htmlfor the main domainpublic_html/subfolderfor addon domains- A specific folder assigned to a subdomain
Each domain has its own document root.
Main Domain Document Root #
For the main domain:
- The document root is usually
public_html - Files placed here load at
yourdomain.com
The main index file must be inside this folder.
Addon Domains and Subdomains #
For addon domains:
- The document root is a subfolder inside
public_html - Each addon domain has its own directory
For subdomains:
- A separate document root is assigned during creation
Files must be uploaded to the correct folder.
Index Files and the Document Root #
The server looks for index files such as:
index.htmlindex.php
If no index file exists, the website may:
- Show an error
- Show a directory listing
- Display nothing
An index file is required for proper display.
Common Document Root Mistakes #
- Uploading files outside the document root
- Uploading to the wrong domain folder
- Having multiple index files
- Missing index files
These mistakes cause websites not to load.
Checking the Document Root in cPanel #
You can verify document roots via:
- Domains in cPanel
- Domain configuration overview
Always confirm the correct folder before uploading files.
Security Considerations #
Files outside the document root:
- Are not publicly accessible
- Should be used for private data only
Sensitive data should never be placed inside the document root.
Responsibility Notice #
You are responsible for:
- Uploading files to the correct document root
- Maintaining proper folder structure
- Securing sensitive files
ProRedLine does not relocate website files automatically.
Still need help after reading this article?
