Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
February 09, 2012, 04:44:28 PM

Pages: [1]   Go Down
  Print  
Author Topic: difference between www and public_html  (Read 1829 times)
gws76
Space Explorer
***
Offline Offline

Posts: 9


« on: January 26, 2010, 03:42:40 PM »

What is the difference between the www folder and the public_html folder?  It appears as if they are repeating the same files.
Logged
jimlongo
Intergalactic Superstar
*****
Offline Offline

Posts: 125



WWW
« Reply #1 on: January 26, 2010, 04:12:18 PM »

None.  The www folder is an alias of the public_html . . . if you delete something from one of them it will be gone from the other.
Logged

gws76
Space Explorer
***
Offline Offline

Posts: 9


« Reply #2 on: January 26, 2010, 04:30:35 PM »

What's the point of having two then?
Logged
jimlongo
Intergalactic Superstar
*****
Offline Offline

Posts: 125



WWW
« Reply #3 on: January 26, 2010, 04:41:19 PM »

There's not two, there's really only one.

I'm not sure why there are the two pointers . . .
Logged

MrPhil
Berserker Poster
*****
Offline Offline

Posts: 5083



« Reply #4 on: January 26, 2010, 05:03:30 PM »

Now (or at some point in the past), some software was coded to look in public_html, and other software was coded to look in www. The easiest fix was to make www an alias (soft link) to public_html. There's only one copy of the files -- so don't go doing something stupid like erasing all the files in "www" (people have done it!).

So, "public_html/index.php" and "www/index.php" are exactly the same file -- the same collection of bits on the same place on the disk. Erase one, and you end up erasing the other. "public_html" and "www" are just two different ways (names) for getting to the same place (the directory containing "index.php"). The concept of a "link" (hard, or soft/symbolic) is familiar to Unix/Linux users, but is foreign to most Windows users. It's just a way of giving multiple names to one file or directory. "Remove directory www" would only get rid of the name, leaving "public_html" intact as the only name for that directory, and likewise for removing "public_html" and leaving "www". Remove the last remaining name for a file or directory, and the file or directory actually gets erased.
« Last Edit: February 12, 2010, 08:44:48 AM by MrPhil » Logged

Pages: [1]   Go Up
  Print  
 
Jump to: