Understanding the public_html Folder

Prev Next

The public_html folder is the web root for your primary domain name.

This means that the public_html folder is the location where you put all the website files that you want to appear when someone visits your primary domain.

Example:

If you have a file called index.html, index.php, or any other valid default file name in the public_html folder it will display that page.

If you do not have a valid default file in the public_html folder a list of contents in the public_html folder will be displayed instead.

Addon Domains and Subdomains

You can also create Addon domains and subdomaints and these will use a folder inside your public_html.

Example:

  • You can create an Addon domain called addondomain.com and it will use a subfolder similar to /public_html/addondomain.com.

  • You could create a Subdomain called forums.domain.com and it would use a subfolder similar to /public_html/forums.

  • If forums.domains.com is defined as a subdomain and addondomain.com is defined as an addon domain then the following examples would apply.

Permissions

Permissions are important for a sites operations and correct functionality, some of the defaults are :

Files/Folders

Permissions

public_html

0750

Folders inside public_html

0755

Files inside of public_html

0755 or 0644


Notes

Some sites may advise you to use 777 permissions, however this is extremely unsafe and at the least should have 755. This is more secure.

These defaults are only some common values, please see with your developer if there are any specific requirements.

Additional Information

The full path to your public_html account (specially when browsing via SSH/terminal) is /home/<username>/public_html