How to setup sub-domains like blogspot

后端 未结 5 1391
深忆病人
深忆病人 2021-02-06 16:48

What should do to setup a sub-domain for the users when they sign-up into my site.

What are the infrastructure required? I am using Linux servers.

5条回答
  •  太阳男子
    2021-02-06 17:25

    You can make a CNAME entry/ A Record in your DNS settings, for each subdomain

    A CNAME record is a record in your Domain Management Settings that allows you to control a subdomain of your domain.

    To automate it along with registration, you can write a script which is executed for each user, when s/he registers.

    You can refer to this link, as well, for a step-by-step process for Apache:

    How to setup subdomains in apache

    (since you mentioned Linux, I assume it must be APache. Please mention if it is otherwise)

    Alternate Solution

    You can also refer to the wildcard solution, given by Alnitak, in the same thread. I find his is an easier way. :)

提交回复
热议问题