What is www and public_html directory in my folder?

Posted 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.

 

30 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!

  9. Mac says:

    I noticed my public_html is the same as html in my domain name I have a index.html in my html and it is siteworx use javapipe what do I do

  10. Carole R Hache LeBlanc says:

    Does someone know where I can find all my website text and picture in the public_html folder?
    My site is not online anymore but I need my web site data.

  11. VEERA INDUSTRIES says:

    VERY EASIER FOR ME TO BE ABLE THAT WOULD BE A GREAT TIME TO GET

  12. veerana velu says:

    LOCATION is a bit more than I am going on a different time

  13. veerana velu says:

    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.

  14. Mandy De Klerk says:

    Hi. You are literally the only online liink I searched that I can understand. My problem is, why is my website not showing when putting in my domain. The index.php and Htacess is under wp in file manager and wp in under public_html

  15. RAJEEV TIWARI says:

    Sir, the public HTML folder is a non-web-accessible location or not? This question is related to (Install OJS so that the files directory is NOT a subdirectory of the OJS installation and cannot be accessed directly via the web server.)

  16. Maria Correa says:

    I am requesting to have removed from my email address (robot text file).

  17. Zahra says:

    Hi.
    in a VPS that no plesk is installed, where is publichtml? Is it wwwroot folder of IIS?

    • wwwroot is a Virtual Directory of IIS server. It may contain many web-site so that are in the separate folder and it would be access by specific path like domain[.]com/mywebsite, where mywebsite is a folder in which files are there for my site.

      Please contact our support via live chat or ticket system, so we can better assist you directly with any service you have ordered through us.

  18. Thanks for the info says:

    Thanks, but, I need clarity on htdocs thanks

  19. Oyun Delisi says:

    There is also a www folder in my cpanel on my oyundelisi.org site. Screaming frog sees these pages as duplicates. Do you mind if I delete the www folder?

    • 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. It doesn’t take extra storage.

  20. Pls who can help me out am confused says:

    Pls who can help me out am confused

  21. Marcellus Wade says:

    I never updated and you guys charged my account

    • Bibin says:

      Please contact our support via live chat or ticket system, so we can better assist you directly with any service you have ordered through us.

Leave a Reply