In this tutorial, you'll learn how you can create wildcard subdomains in CWP NGINX and Apache easily via the predefined template.

First

Ensure and check that you've wildcard DNS added to your current DNS hosting provider or in CWP DNS if you're using your own nameservers :

example DNS entry:-

*.domain.tld. 14400 IN A 192.168.1.100

Second

Go to CWP-admin dashboard >> Webserver Settings >> Webservers Domain Settings

there you need to choose the user and then the domain name where you need to set the wildcard subdomain support.

Third

Click on the button "Create configuration" which is located next to the domain name for which you need to enable the wildcard subdomain

Fourth

Choose "Nginx + Php-fpm" or "apache + php-fpm" or "nginx + apache + php-fpm" or "nginx + apache + php-cgi" according to your choice of engines.

If you've chosen "nginx + php-fpm" select the "wildcard" template under "Nginx default vhost template" and save the changes by click on rebuild vhost option.

If "apache + php-fpm" is chosen select "wildcard" template under "Apache default vhost template" and save the changes by click on rebuild vhost option.

If "nginx + apache + php-fpm" or "nginx + apache + php-cgi" is chosen select the "wildcard" template under "Nginx default vhost template" also select "wildcard" template under "Apache default vhost template" and save the changes by click on rebuild vhost option.

That's it you've easily enabled wildcard subdomain support for your domain

**SAME CAN BE DONE FOR SUB-DOMAIN