How to create subdomains in php via script?
Printable View
How to create subdomains in php via script?
If you modify the access level of the web browser's configuration file (usually 'httpd.conf' or similar) appropriately, you could read from and write to that file using a PHP script.
Hi dineshmatolia,
penegate is hinting that you can create subdomains by adding rules to the httpd.conf file. So your going to need permission to access that file. If you're on a shared host then it is unlikely that they will allow you to write to that file.
They may allow you to create subdomains via a control panel however.
You'll also need to modify your DNS records appropriately. If you haven't already, I suggest adding a catch-all (wildcard) record, which will allow you to receive all requests to your domain regardless of subdomain. You can then control the subdomains via your web server's configuration file, if you have the appropriate access rights. I agree that on shared hosting this is less likely to be possible.