The public_html folder

The web root for your domain name is the public_html folder. You put all website files that you desire to be shown when someone types your main domain in it.



Some examples:

If you have a file named index.html in the public_html folder, it will show just this page.

In other case if you do no have a default file in the public_html folder (like index.html, default.html, etc.), then as a result a list of files in the public_html folder will be shown.

Path in File Manager (or in FTP)

Corresponding URL in a Web Browser

/public_html/

http://www.yourdomain.com/

/public_html/pagename.html

http://www.yourdomain.com/pagename.html

/public_html/folder/

http://www.yourdomain.com/folder/

/public_html/folder/page.html

http://www.yourdomain.com/folder/page.html


Note: Replace yourdomain.com with the primary domain of your account.

Addon Domains & Subdomains

It’s possible to create Addon domains and Subdomains, if you wish and they will use a folder inside public_html.

Some examples:

See also: The Difference between Parked, Addon and Subdomains

If you make an Addon domain called addondomain.com, it will use a subfolder similar to /public_html/addondomain.com/.

Other example is creation of a Subdomain called myhost.yourdomain.com, which would use a subfolder similar to /public_html/myhost/ (unless you specified otherwise).

If myhost.yourdomain.com is defined as a subdomain and addondomain.com is an addon domain, then the following examples run:

Path in File Manager (or in FTP)

Corresponding URL in a Web Browser

/public_html/myhost/

http://myhost.yourdomain.com/

/public_html/addondomain.com/

http://www.addondomain.com/


Note: Replace yourdomain.com with the primary domain on your account. It’s necessary to replace addondomain.com with the additional domain, that you’ve already added in the "addon domains" section of cPanel, too.

In case you don’t wish additional domains to be subfolders of public_html, VPS, dedicated hosting or reseller is recommended and good solution. So, you will be able to put each domain in separate own cPanel. Shared accounts take only one cPanel. That’s the reason all addon domains to be subfolders of the public_html folder.

Permissions

The public_html folder must always have 0750 permissions. All folders inside the public_html folder must contain 0755 permissions. All files inside the public_html folder must have 0755 or 0644 permissions.

Some websites recommend usage of 777 permissions, but according to our experience use of 755 permissions is more secure. The choice is yours.




Was this article helpful?

mood_bad Dislike 0
mood Like 7
visibility Views: 5191