what is the difference between www and public_html? I have hosed my domain in a small hosting company and when i was going through all its folders i found both the folder www and public_html has the same content. but by hosting company asks me to upload all my files into public_html. Iam curious to know the difference between these two folders.
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. That they suggest uploading to public_html means that the folder is public_html and www is just an alias set up to point to that folder.
Felgall is right, they are basically the same thing the way that most servers are setup. I have seen some servers setup where the public_html folder would show when you go to the address http://yoursite.com and the www folder would show when you go to www.yoursite.com but this is not the normal setup.
Cpanel have alias set to point public_html to www …both show the same files its just the mirror image this things are done for the apache config that cpanel uses …so no need to worry about this one.
There are some programs that expect the folder to be public_html and some that expect www so by giving the one folder both names they make sure that the programs will work whichever of the two names that the program expects.
Yes thats right, you can upload to either www or public_html, both will hold your wesbites files which you upload. www is just a linked folder over public_html.
what was purpose of creating these 2 folders?
means one could have done…
in windows we have www only…
any specific technical reason…
or can i delete www folder…
or
will deleting www delete public_html ( could not test on live server)
You’re better off leaving it (It shouldn’t break anything, but there’s no telling if it would in the future and it does no harm), there is only one folder, www just happens to be a shortcut (if you want to use Windows speak) to the public_html folder - It’s to cover the bases really. Some people will be expecting www to be the folder to upload to - and it makes more sense if you’re not used to it.
Not if public_html is the real folder and www is the shortcut - but it will break whatever there is on your saite that references www instead of public_html (perhaps some of the tools in the control panel).
I have the same problem.
I have to disagree with you.
I have placed files in the www directory, because from my old server i backed it up this way.
It reads only from the public_html, so the files in the www folder will not be shown when i type www.domain.com
Also i can place different files seperately in www and public_html so they show different files. NOT SAME at all. You need to put all your files in public_html otherwise it will not work. at least not by default