Wildcard subdomain hosting?

MAZICJA

New member
Joined
Mar 1, 2018
Messages
3
Best answers
0
Points
1
#1
How do I host my wild card subdomains such that the main website automatically creates a subdomain website for all new clients in the format CLIENT.MYWEBSITE.COM. I have a website built with PHP such that once a client registers it automatically creates a subdomain for the client in the format CLIENT.MYWEBSITE.COM. I need assistance on how to host the site. Several web hosting companies I have contacted said they cannot do it but I know this is doable.
 

KnownHost-DanielP

Well-known member
Joined
Mar 1, 2018
Messages
121
Best answers
2
Ratings
27 3
Points
28
#2
It really depends on your software and what you want to accomplish.

What kind of website access are you giving your clients? Do you want them to have some kind of control panel and FTP access, or are you simply giving them some kind of web gui access?
 

MAZICJA

New member
Joined
Mar 1, 2018
Messages
3
Best answers
0
Points
1
#5
MAZICJA
.

Its a php b2b website. And the control they will have is only admin access through the websites admin. They will not have cpanel and ftp access
 

KnownHost-DanielP

Well-known member
Joined
Mar 1, 2018
Messages
121
Best answers
2
Ratings
27 3
Points
28
#6
KnownHost-DanielP
In that case, it's really easy.

*Assuming* you are using cPanel, you will want to create a wildcard subdomain. It's literally entered as *.domain.com and point that to your public_html document root.

Your b2b software will then need to write htaccess re-write rules for each subdomain, very similar to how WP multi-site does it.

So say I signup and get daniel.yourdomain.com, all you do is add a htaccess re-write rule to parse daniel.yourdomain.com -> my content page/area

You can also do this in your code by parsing the domain there as well from the headers, but rewrite rules would be cleaner I think.
 

VirtuBox

Global Mod
Staff Member
Joined
May 3, 2016
Messages
1,618
Best answers
4
Ratings
455 13
Points
83
#3
How do I host my wild card subdomains such that the main website automatically creates a subdomain website for all new clients in the format CLIENT.MYWEBSITE.COM. I have a website built with PHP such that once a client registers it automatically creates a subdomain for the client in the format CLIENT.MYWEBSITE.COM. I need assistance on how to host the site. Several web hosting companies I have contacted said they cannot do it but I know this is doable.
With a control panel like cPanel, I'm not sure about how you can configure a wildcard subdomain.
But on a basic LEMP stack with Nginx, you can directly set a wildcard in the vhost configuration like this :

Code:
server {

    server_name yourdomain.tld   *.yourdomain.tld;
...
...


}
 
Joined
Mar 1, 2018
Messages
25
Best answers
0
Ratings
1
Points
1
#4
If you have a wildcard cert, you should also just be able to apply individually to each of your sub-domains in whatever control panel or software you are using, if it restricts you to do it that way.
 
Similar Threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top