Subdomains

Discussion in 'PHP' started by PeterB, Mar 27, 2006.

  1. #1
    Hey there,

    I've been busy with a website, but at the moment I'm stuck on a problem.
    I'd like to make subdomains automatically with PHP, but don't know how to do that.
    After I fill in a form, PHP should create a subdomain and an url for redirecting from the subdomain.
    I want to use this for search engine optimalisation, I heard this is a good way to index the website into Google.

    I saw http://www.2dehands.nl/ uses the same system: By clicking a category you'll go to http://CATEGORY.2dehands.nl/

    So, is this possible and if it is: How?

    I've heard about wildcard and mod rewrite, but I don't know what is the best option and how to create it.

    Many thanks,
    Peter Bosch.
     
    PeterB, Mar 27, 2006 IP
  2. Slapyo

    Slapyo Well-Known Member

    Messages:
    266
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #2
    You should edit your .htaccess file.

    http://www.tips-scripts.com/?tip=pointing#tip

    Go there, and scroll to the bottom example which starts with "There is a second approach where..." This makes it sound like what you want.
     
    Slapyo, Mar 27, 2006 IP
  3. PeterB

    PeterB Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hmm, I have to create dirs myself this way. And only this .htaccess change isn't enough. I have to change my DNS settings also.

    If I add "* A SERVER-IP" to my DNS settings and I'm going to a random subdomain page, I see an apache screen saying "Hey, it worked !".

    Anyone knows how to fix this?
     
    PeterB, Mar 28, 2006 IP