Understanding the public_html Folder
  • 08 Feb 2023
  • 1 Minute to read
  • Dark
    Light

Understanding the public_html Folder

  • Dark
    Light
  • New

Article Summary

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 defualt 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

The public_html folder should always have 0750 permissions.
All folders inside the public_html folder should have 0755 permissions.
All files inside the public_html folder should have 0755 or 0644 permissions.
Some websites and scripts may advise you to use 777 permissions, however, it is recommend that they be configured as 755 as it is more secure.

Additional information

The full path for the public_html folder is actually /home/username/public_html where the username is replaced by the cPanel username.








Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.
ESC

Eddy, a super-smart generative AI, opening up ways to have tailored queries and responses