Create subdomains on the fly with .htaccess (PHP)

后端 未结 9 1699
情深已故
情深已故 2020-11-22 02:07

I am looking to create a system which on signup will create a subdomain on my website for the users account area.

e.g. johndoe.website.com

I think it would

9条回答
  •  不知归路
    2020-11-22 02:30

    I think the wild card DNS with Apache's Dynamic Mass Virtual Hosting is a reasonable solution also. Although, I have never tried it.

    If you have the need to scale out to multiple servers or the other solutions just don't work for you, I recommend using a database driven DNS server. I have successfully used MyDNS in the past. Since it uses MySQL (or PostgreSQL) you can update your DNS on the fly with PHP or just about anything else. The code doesn't look like it has been updated in a while, but it's DNS and therefore not exactly cutting edge.

提交回复
热议问题