How to dynamically create subdomains

2019-01-26 16:58发布

I want to dynamically create new sub domains on my website. i mean if you have example.com then you dynamically create sub.example.com .

i looked on google and there was nothing really good. i downloaded some scripts but they were all not working. my website is based on php so please if there is anyway i can do it in php tell me, and also if it can be possible with python then that is awesome!.

2条回答
萌系小妹纸
2楼-- · 2019-01-26 17:11

You can't do this unless you have permission to alter the DNS server for your domain.

查看更多
太酷不给撩
3楼-- · 2019-01-26 17:16

You need to setup a wildcard subdomain. Basically, anything.mysite.com will resolve to mysite.com. At that point it's up to your code to kick in and serve up the proper content depending on what subdomain the user is looking at.

http://www.google.lk/search?q=wildcard+subdomain

查看更多
登录 后发表回答