Skip to main content

How to create subdomains for domains via a php script?

Comments

3 comments

  • cPanelMichael
    Hello :) The following documents are a good place to start when developing a custom PHP script that creates subdomains: Thank you.
    0
  • whatsapprank
    I think you may be talking about a virtual domain in which case you need to create a new DNS entry in the named file as well as a new VirtualHost container in the httpd.conf file.
    0
  • RyanBVI
    If you have an MVC php application with managable routes, maybe you would also find useful the wildcard DNS, so that ALL subdomains point to a specific php file / router, so you can programmatically further control the execution ... (In cPanel, add a subdomain with: * and point it to have document root to the folder that you have an index.php that serves as your "router"...)
    0

Please sign in to leave a comment.