Hi, I’m trying to build a social network where you can access public profile with <username>.social.com. I have created paramterized hostname rule in the main config file for this purpose. So my question is do we have to run a script on the server’s cpanel to create a subdomain corresponding to <username>.social.com whenever a user is created. ![]()
Is there an external API perhaps, that you can use to access cPanel from inside the server?
This is doable quite easily using wildcard domains (DNS + webserver configuration).
Ask your hosting provider.
And if he cant do it (shared hosting, for example), I think that’s a baaad choice for social network ![]()
Now I’ve realized what I’ve been confused of was that I assumed <username>.domain.com will work right away by using Yii parameterized hostname without having to add subdomain to DNS. So I think I’ll run a script that request CPanel to add user’s subdomain every time a user registers.
Actually I misunderstood your suggestion. I have found a way to set up wildcard subdomain on my server and it works.