Wildcard subdomain hosting?

MAZICJA

New member
Registered
Joined
Mar 1, 2018
Messages
3
Points
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
Hosting Provider
Registered
Joined
Mar 1, 2018
Messages
121
Points
28
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
Registered
Joined
Mar 1, 2018
Messages
3
Points
1
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
Hosting Provider
Registered
Joined
Mar 1, 2018
Messages
121
Points
28
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

Well-known member
Registered
Joined
May 3, 2016
Messages
1,622
Points
83
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;
...
...


}
 

Purely

Member
Registered
Joined
Mar 1, 2018
Messages
25
Points
1
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.
 
Latest Threads
Replies
0
Views
115
Replies
0
Views
65
Replies
0
Views
57
Replies
1
Views
87
Recommended Threads
Replies
1
Views
1,697
Replies
3
Views
1,567
Replies
0
Views
905
fiz
Similar Threads

Latest postsNew 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