how to create a subdomain in php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tariquetuku
    New Member
    • Aug 2008
    • 13

    how to create a subdomain in php

    i want to create a subdomain upon each user registration as

    user.example.co m

    how it is possible?

    thanks
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    if you’re using apache, you could use mod_rewrite to map user.example.or g to www.example.org/user/ or www.example.org/?id=user

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      PHP does not control the server, it only runs on it. However, PHP can be used to modify the configuration files for the server. The modifications will depend upon the server (Apache, IIS, etc.).

      Comment

      • nilayanand
        New Member
        • Nov 2006
        • 10

        #4
        Configure your apache/other-web-server for wildcard subdomain. Then your PHP script can read the subdomain using $_SERVER['HTTP_HOST] and can serve the data accordingly.

        Comment

        Working...