how do i create personal sub domain programmatically with php

≡放荡痞女 提交于 2019-11-29 12:53:16

You need to setup a wildcard DNS record to catch all subdomains and send them to you web server.

Then you need to setup Apache to catch all named virtual hosts and send it to a directory.

In the directory you would set htaccess to send all requests to one script which would read the sub domain from the server variables and handle it accordingly.

If you want mydomain.com/xxx, then that's just a folder. Some hosts will also take mydomain.com/xxx and automatically make xxx.mydomain.com point to it without needing any configuration on your part. Might want to check that this isn't already the case for you.

How would you create the subdomain manually?

Good. Now automate it.

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