Where to put your website files

Almost every "my site shows the wrong thing" question comes down to files being in the wrong folder.

public_html

This is your website. A file at public_html/index.html is what people see at yourdomain.com. Anything above public_html – in your home directory – is not reachable from the web at all, which is why we keep backups and scripts there.

The index file

A web server serves index.html or index.php when someone asks for a folder. If neither exists you get either a directory listing or a 403. If you have uploaded home.html and expect it to appear, it will not.

The commonest mistake

Uploading a folder rather than its contents. If you upload mysite containing index.html, you end up with public_html/mysite/index.html, and your site appears at yourdomain.com/mysite while the main address shows nothing. Upload the contents, not the containing folder.

Addon domains and subdomains

Each gets its own folder, usually inside public_html. Check in cPanel which folder a domain is pointed at before uploading – putting the files in the right place for the wrong domain is easily done.

Case matters

Our servers are case-sensitive. Logo.PNG and logo.png are different files. A site built on Windows can work locally and show missing images once uploaded, entirely because of capital letters.

What not to put in public_html

Backups, database dumps and spare copies. If it is in public_html, it can be downloaded by anyone who guesses the name. Keep those in your home directory instead.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Changing web hosts: A Step by Step Tutorial

Here is how you can move your site(s) to our servers:1 - Log in to CPanel of your previous host...

Your first steps after signing up

Here is the order to do things in, whether you are launching something new or moving an existing...

Previewing your site before you point the domain

You can build and test a site here while the live one carries on elsewhere. This is the single...

Going live: a checklist

Work through this before and just after pointing the domain at us. Before Site working when...