Create a wildcard subdomain
Add a *.example.com wildcard subdomain in cPanel so any subdomain resolves, for WordPress Multisite or wildcard SSL.
Create a wildcard subdomain so that any subdomain of your domain resolves to your site, including ones that do not exist yet. Applies to shared and reseller hosting.
A wildcard matches every request for a subdomain you have not explicitly created. The two things people usually need it for are WordPress Multisite in subdomain mode, and wildcard SSL certificates.
Create it
-
In cPanel, open Subdomains under Domains.

-
In Subdomain, enter a single asterisk:
*
-
Choose the domain it applies to.

-
cPanel fills in a Document Root automatically. Change it if you want the wildcard to serve your main site rather than its own directory.
-
Select Create.

You should see a confirmation.

Check it worked
Request a subdomain you have never created:
curl -sI https://anything-at-all.example.com | head -n 1It should reach your site rather than failing to resolve.
Point it at your main site
By default the wildcard gets its own document root, so unknown subdomains show
an empty directory rather than your site. If you want them to serve the main
site instead, set the Document Root to public_html when creating it — or
change it afterwards under Subdomains.
WordPress Multisite
Multisite in subdomain mode needs the wildcard, and it writes its own
.htaccess rules during setup, so there is nothing further to configure. See
WordPress Multisite subdomains.
Wildcard SSL
AutoSSL does not issue wildcard certificates. For *.example.com you need
Let's Encrypt with DNS validation — see
Install a wildcard certificate via Let's Encrypt.