Subdomain created by user

2

I'm developing a user area system, when registering, this user will have their area with their subdomain, chosen by him.

Doubt:

How to make this registry subdomain, since it will not have access to cPanel. I've seen this on gringo site. How can I do this? It could be by Apache, or by PHP itself.

    
asked by anonymous 10.06.2015 / 21:01

1 answer

0

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

    
10.06.2015 / 21:28