PHP Virtual Subdomain Creating

Discussion in 'Apache' started by Python, Mar 30, 2007.

  1. #1
    Hello,

    I have been looking all over the internet to try to figure this out but havent found any good information on it.

    I am building a website which allows user registration. I want each user to have their own homepage sort of.

    So i want:

    http://username.mydomain.com

    to point to http://www.mydomain.com?homepage.php?id=username




    I know that .htaccess is involved. I dont want to have to create each domain manually in cPanel - it should happen dynamically. When someone goes to http://username.mydomain.com that address must remain in the address bar.

    How can I do this?

    Thanks
     
    Python, Mar 30, 2007 IP
  2. rodney88

    rodney88 Guest

    Messages:
    480
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    0
    #2
    How I did it.

    In place of the last line, you want something along the lines of:
    RewriteRule . homepage.php?id=%2 [L]
     
    rodney88, Mar 31, 2007 IP
  3. Python

    Python Well-Known Member

    Messages:
    680
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    120
    #3
    Thanks.
    I havent tried it yet but will do soon.
     
    Python, Apr 1, 2007 IP