How to create subdomains for domains via a php script?
Hey!
What I want to do is to run a php script to which I feed in a list of subdomain names and then it would automatically create those subdomains for a specified domain (and connect those subdomains with folders on my hosting account).
-
Hello :) The following documents are a good place to start when developing a custom PHP script that creates subdomains: Thank you. 0 -
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 -
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.
Comments
3 comments