subfolders for each registered user ( similar to myspace )

Discussion in 'Apache' started by nialler, Dec 19, 2006.

  1. #1
    Hi,

    When a user signs up to my site I want them to get a personal url like www.mysite.com/username, similar to myspace etc.

    I don't want my web root at /var/www/ filled with subfolders or symlinks and would prefer to have them down one level , such as in a users folder.

    Does anybody have any suggestions on how i can achieve this?

    Thanks!
     
    nialler, Dec 19, 2006 IP
  2. netfreehost

    netfreehost Peon

    Messages:
    136
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can do this with .htaccess file.
     
    netfreehost, Dec 22, 2006 IP
  3. WhiteHatHacker

    WhiteHatHacker Peon

    Messages:
    21
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    My personal favourite line which I have ever written ever in an htaccess file uses PHP to manage what page to return.

    RewriteRule ^([^&]*)$ /index.php?f=/$1& [QSA,L]

    Sends a request with any GET information to index.php, with the path as variable $_GET["f"] - only thing is, any requests with f as a GET variable make the submitted "f" override the internal one.
     
    WhiteHatHacker, Dec 29, 2006 IP
  4. nialler

    nialler Peon

    Messages:
    97
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks guys, will give that a shot.

    Sorry for taking so long to reply by the way, got distrated by the many other jobs on my TODO list for the site :eek:
     
    nialler, Jan 8, 2007 IP