What is www and public_html directory in my folder?

By on October 23rd, 2015

 

The public_html directory is the folder to place in web-readable files. This means that public_html is the folder where you put all website files which you want to appear when someone types your main domain. Files placed below the public_html folder will not be visible on the web. The www folder is what is called a symlink. This points to the public_html folder and generally is used as a shorthand is cgi scripts for the path. Instead of using the path /home/yourusername/public_html you can use /home/yourusername/www. The www directory is simply a symbolic link to the public_html directory. So anything you place in either directory will be identical when viewed from the other directory on the server. One is usually set up as an alias for the other meaning that it doesn’t matter which of the two you use because they both point to the same folder.

 

public_html folder

The public_html folder is the web root for your primary domain name. when someone types your domain name into their browser, whatever is in your public_html directory is what will be shown to them. We can explain this using an example: If you have a default filename like index.html or default.html inside your public_html folder, then when someone call your domain name it will display that page. If you don’t have any default file in your public_html directory, then a list of files in the public_html folder will be shown.  You can create addon domains and sub domains in your account and if you have added an addon domain called myaddon.com then it will use the subfolder similar to /public_html/myaddon.com/or if you are added a sub domain called mysubdomain.com then it will use the subfolder similar to /public_html/mysubdomain.com/

In Shared hosting accounts, you will get only one cPanel account, which is why all addon domains are subfolders of the public_html folder. If you do not want the additional domains to be subfolders of the public_html, then go with the reseller, VPS or dedicated hosting is a better solution since you can put each domain in its own cPanel to keep it separate from other domains.

 

How to access the public_html folder?

You can access your public_html folder from your cPanel interface. Please follow the below given steps to know about how to access your public_html folder from your cPanel account.

1) Login to your cPanel account.

2) Navigate to Files >> File Manager.

www and publichtml

 

3) You can see the public_html folder on your File Manager page.

www and publichtml

 

public_html directory

 

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 0644 permissions.

 

If you need any further help, please do reach our support department.

 

10 Responses to “What is www and public_html directory in my folder?”

  1. Solomon says:

    Wow !am satisfied with this post.very helpful

  2. JAYARAJ J S says:

    Really useful i had a lot of confusion over this matter,,thanks

  3. Marcus says:

    This answers half of a question I had.

    I read an article which suggests that a php file for connecting to a MySQL database should be stored outside of public_html.

    If I want to achieve this, where would I put the file, and how what would the reference to it be for a php require_once call?

    Could I use non public space for other items? For example, if users upload an image, can I store it in a non-public space before the content is moderated?

  4. Ruben says:

    Cristal clear explanation. It entlights my understanding. Many many thanks.

  5. kelly says:

    Hi whenever i try to access my website url it takes me to

    below page . what wrong i might have done .can you tell me steps to rectify that so that i can directly land on my web page . Thanks much.

    Index of /
    Name Last modified Size Description
    cgi-bin/ 2020-05-17 12:48 –
    favicon.ico 2018-10-16 04:57 15K
    wp/ 2020-02-06 12:03 –

  6. Mark Joseph says:

    I accidentally built my website below the public_html
    folder. If I move it itside, it no longer shows on the web.
    What should I do? Everything seems to be working properly,
    but maybe this configuration will cause problems later on
    How can I properly move it inside the public_html folder?
    This is an on web site builder, there are no files on my computer
    that I can simply re-upload.

  7. SHR says:

    Iii cann nottt downlodeeee

  8. Hiren says:

    I do not find public_html file in my vista panel file manager..please help

    • Hello,

      Greetings from InterServer.

      InterServer offers support for the control panels we issue license from our portal like – cPanel, DirectAdmin, Plesk, Webuzo.
      Vesta paths seems like: cd /home/user/web/yoursite-site.ltd/public_html/ – For more details please contact their support.

      Thank you!

Leave a Reply