Uploading Website Files Correctly: Understanding public_html, index.php, and Your Homepage
If you want to manually upload a website to your hosting account, it is crucial to place the files in the correct folder. Many issues do not arise from defective files, but rather from website files being in the wrong directory, a missing start file, or a ZIP archive that was uploaded but not extracted.
This article explains the role of the public_html folder, why files like index.php or index.html are important, and how to avoid common upload errors.
In many cPanel accounts, the
public_html folder is the public web directory for your main domain. Files that you want visitors to see when they visit your domain must normally be located in this folder or in the domain's specific document root.What is public_html?
In many cPanel hosting accounts, public_html is the web root directory for your main domain. This means that when a visitor accesses your domain in a browser, the web server looks for the files to be publicly delivered in this folder.
Typical files and folders inside public_html include:
index.phporindex.htmlas the start file,.htaccessfor redirects and web server rules,- folders such as
images,css,js, orassets, - for WordPress, files like
wp-config.phpand folders likewp-content.
Important: For add-on domains, subdomains, or separately configured websites, a different folder may be used as the document root. Therefore, always check which folder belongs to the respective domain.
What Is a Start File?
When a visitor accesses just your domain, for example example.ch, the web server needs to know which file should be displayed as the homepage. Common start files are:
index.htmlindex.htmindex.php
If there is no suitable start file in the web directory, the website may display an error message, show a directory listing, or present an empty or unexpected page, depending on the configuration.
A file named
start.html, home.html, or my-site.html is not automatically recognized as the homepage. As a rule, rename your desired start file to index.html or index.php, unless your application requires otherwise.Uploading Website Files via File Manager
- Log in to cPanel.
- Open the File Manager.
- Navigate to the correct web directory, often
public_html. - Click on Upload.
- Select the desired file or drag and drop it into the upload window.
- Wait until the upload is completely finished.
- Return to the File Manager and check whether the file is in the correct folder.
If you want to upload many files, it is often better to upload them as a ZIP file first and then extract them in the File Manager. For very large projects or many individual files, FTP or SFTP may be more convenient.
Uploading Website Files via FTP or SFTP
For larger projects, many files, or regular changes, an FTP, FTPS, or SFTP client is recommended. Also, make sure to transfer the files to the correct target folder.
Typical connection details are:
- Server or hostname,
- Username,
- Password,
- Port,
- Protocol: FTP, FTPS, or SFTP.
The same applies to FTP/SFTP: if files do not land in the correct document root, they will not appear on the website.
ZIP File Uploaded, but Website Doesn't Appear?
A common mistake is uploading a ZIP archive to public_html without extracting it. The web server cannot automatically display a ZIP file as a finished website.
The correct procedure is:
- Upload the ZIP file to the desired folder.
- Select the ZIP file in the File Manager.
- Click Extract.
- Check if the files are located directly in the correct directory.
- Remove the ZIP file after successful extraction if it is no longer needed.
Be particularly careful about whether the archive creates an additional subfolder upon extraction. If your start file is then located in public_html/my-website/index.html, but your domain points to public_html, it will not be displayed automatically when accessing the domain directly.
Mind Case Sensitivity
On web servers, case sensitivity in filenames is often relevant. Image.jpg, image.jpg, and IMAGE.JPG can be treated as different files.
If an image or a file does not load, check:
- whether the filename is exactly correct,
- whether the file extension is correct,
- whether the case in the link and the file are identical,
- whether the file is in the correct folder.
Typical Upload Errors
| Problem | Possible Cause | Solution |
|---|---|---|
| Website displays nothing | Files in the wrong folder. | Check the domain's document root. |
| 403 Forbidden | No start file or incorrect permissions. | Check index.php/index.html and permissions. |
| 404 Not Found | File missing or incorrect path. | Check filename, path, and case sensitivity. |
| Only ZIP file visible | Archive was not extracted. | Extract the ZIP file in the File Manager. |
Best Practices
- Always upload website files to the correct document root.
- Ensure that a suitable start file is present.
- Use simple filenames without special characters.
- Pay attention to case sensitivity.
- Extract ZIP files after uploading.
- Delete old archives after successful setup.
- Create a backup before overwriting existing files.
For your website to be displayed correctly, the files must be in the correct web directory. For the main domain, this is often
public_html. A start file such as index.php or index.html is crucial so that the web server knows which page to display when the domain is accessed.If you are unsure whether your files are in the correct folder or why your homepage is not being displayed, the CURIAWEB support team is happy to assist you.
Create Support Request