How To Configure Wildcard Sub Domain

12th Jan, 2023

You can easily configure wildcards from your Cpanel.


Firstly, log in to your Cpanel.


Now, navigate to Subdomains under the Domains option.

Figure 1



Now, you will get redirected to another page where you will have the option to create new Subdomains.


Figure: 2


Here we create a saas subdomain for our application.


Figure: 3


We give a name saas on the subdomain field (ref 3.1). select our root domain (ref 3.2) (Here we use example.com as our root domain) and give a document root saas.example.com (ref 3.3).


After fill, the three filed click on the create (ref 3.4) button to submit the form. After successful submission, you will be redirected to the success page.



Figure: 4


Now we create a wildcard subdomain for our newly created subdomain.


Click on the Go Back (ref 4.1) button to go to the subdomain create page.


Figure: 5


To create a wildcard subdomain, just fill the subdomain field (ref 5.1) with an (*). select our root domain (ref 5.2) (Here we use saas.example.com as our root domain).

When you fill the subdomain with (*) it will automatically fill the document root with a _wildcard_ folder name (ref 5.4). You need to remove the _wildcard_. from your document root field and give the same document root as the selected domain. Here we give the document root saas.example.com (ref 6.3)



Figure: 6


After fill, the three filed click on the create (ref 6.4) button to submit the form. After successful submission, you will be redirected to the success page.



Figure: 7


Now we create a wildcard subdomain for our root (example.com) domain.



Figure: 8


To create a wildcard subdomain, just fill the subdomain field (ref 8.1) with an (*). select our root domain (ref 8.2) (Here we use .example.com as our root domain).


When you fill the subdomain with (*) it will automatically fill the document root with a _wildcard_ folder name (ref 8.3). You need to remove the _wildcard_. from your document root field and give the same document root as the selected domain (ref 9.3). Here we give the document root public_html



Figure: 9


After fill, the three filed click on the create (ref 9.4) button to submit the form. After successful submission, you will be redirected to the success page.





After successfully creating the wildcard subdomain please check the root domain and the wildcard subdomain has the same document root. Here are root domain is saas.example.com and our wildcard domain is *.saas.example.com both share the same document root saas.example.com





Note: Wildcard domains need some time(24-48 hours) to activate due to the propagation process.


Categories