User created subdomain

Asked

Viewed 74 times

2

I am developing a user area system, when registering, this user will have his area with his subdomain, chosen by him.

Doubt:

How to do this subdomain registration, and he will not have access to cPanel. I’ve seen this on gringo site. How can I do this? It can be by Apache, or by PHP itself.

1 answer

0

You can try to look at the value of $_SERVER['HTTP_HOST']; that variable contains the part right after the http://…, to the first bar (commonly, the "domain" of the site). Then you would only need to make a DNS appointment and configure Apache to do qualquercoisa.meudominio.com always fall on the same site (and therefore on your HTTP script).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.