Results 1 to 2 of 2
  1. #1

    Creating subdomains with PHP


    I'm thinking about a site on which for every user account a PHP script will automatically create a subdomain entry. I want this to be a weblog site and the redirection if any should be completely transparent.

    For example user john comes to the site and creates his account. is automatically created. Then when john creates an entry in his weblog it can be referenced as and it will not visibly redirect but show his entry.

    For the first step I need to know what the PHP script should add in which config files.


  2. #2
    Join Date
    Apr 2003
    Vancouver, Canada
    Your best bet is to make an additional file (so you wont have to do too much parsing) in the httpd config directory. Then include it into your httpd.conf file:

    /etc/httpd/conf/subdomains.conf <-- php can add sub domain directives to this file

    /etc/httpd/conf/httpd.conf <-- this file would have to do an "include" of the subdomains.conf file, instructions at

    And then you could just setup a wildcard DNS entry for your domain so you don't have to keep adding subdomains to your DNS.
    Paradox Web Hosting - [email protected]
    - Shared and Dedicated Hosting Solutions:
    - Auto Sales Manager 2004 now available!:

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts