How to dynamically create a sub-domain from a simple webpage? [closed]

我们两清 提交于 2019-12-13 08:58:56

问题


What is the best way to create the sub-domain automatically from PHP. I want to develop a application in php in which a user can automatically create a sub-domain from my domain if he/she fills the registration form sucessfully.


回答1:


  1. Set up wildcard DNS for your subdomains (how you do this depends on your DNS server (or service provider)).
  2. Configure your HTTP server so that your default virtual host will get everything from the wild carded DNS (how you do this depends on your HTTP server).
  3. Pay attention to $_SERVER['HTTP_HOST'] in your script.


来源:https://stackoverflow.com/questions/17595293/how-to-dynamically-create-a-sub-domain-from-a-simple-webpage

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!