How to make www.mysite.com/ + personal extension name?

Discussion in 'PHP' started by youlichika, Aug 27, 2010.

  1. #1
    Hello, I have a PHP personal space systems. It allows the user registration, then get a personal space. But all it points the URL address to www.mysite.com. What php documents should I modify, make it like FACEBOOK: each user has his own URL address, convenient to share with his friends. (www.mysite.com/ + personal extension name) Thanks.
     
    youlichika, Aug 27, 2010 IP
  2. HuggyEssex

    HuggyEssex Member

    Messages:
    297
    Likes Received:
    4
    Best Answers:
    2
    Trophy Points:
    45
    #2
    HuggyEssex, Aug 27, 2010 IP
  3. georgiivanov

    georgiivanov Member

    Messages:
    62
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    25
    #3
    As HuggyEssex said, you need mod_rewrite module for apache. Then you create .htaccess file in the root of your site and add the following:

    What the above rule to: If the requested URI is not an existing directory and is not an existing file, then you are redirected to user.php with id=YOUR_USERNAME_IN_URI.
     
    georgiivanov, Aug 27, 2010 IP
  4. youlichika

    youlichika Greenhorn

    Messages:
    74
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #4
    Thanks a lot. The mod_rewrite and .htaccess are new for me. I am reading the tutorial. But it is difficult to know more in a short time.
    I have checked my php system. it has already had a .htaccess. and wrote somthing in it.
    What should I do next? post the georgiivanov's code below it? it was not work. Would you like to help me more? Thanks again.
     
    youlichika, Aug 27, 2010 IP