Is it possible to create subdomains dynamically on server using php script?
I want to create it.
My server is on hostmonster. And I want to create subdomains dynamically.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m not exactly sure what you’re after, but here’s something to think about.
Your DNS needs to be configured to support it by having a wilcard dns record that points to your web server. For instance
*.mydomain.com.Once done, you can use
$_SERVER['HTTP_HOST']to determine which host is being accessed. Alternatively, you could let PHP add the subdomain inside the web server configuration.I wouldn’t recommend doing this unless you really really know what you’re doing.