Facebook doesn't give users their own directory. Giving a user their own directory takes lots of server resources, lots of effort on the back-end, and after you have several million users the clutter in the file-allocation table would cause page loads to be horrendous. Then take into account all the wasted disk space since hard drives operate on a paging system, AND you'd need an index.html file for each directory...
What Facebook does instead is write a line to a .htaccess file. When a user says they want www.facebook.com/username
, facebook adds the following:
RewriteRule username profile.php?id=<user id>
There are better ways to do this, even. You could have EVERYTHING redirect to parse_request.php
, which will determine if you were requesting a user's specific page, or if you were requesting a static page (like welcome.php
) which shouldn't change.