# Create a wildcard subdomain
Source: https://docs.webgee.com/en/hosting/how-to-add-wildcard-subdomain-through-cpanel













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 [#create-it]

1. In cPanel, open **Subdomains** under **Domains**.

   <img alt="The Subdomains entry in the cPanel Domains section" src="__img0" />

2. In **Subdomain**, enter a single asterisk: `*`

   <img alt="The Subdomain field containing an asterisk" src="__img1" />

3. Choose the domain it applies to.

   <img alt="The domain selector" src="__img2" />

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

5. Select **Create**.

   <img alt="The Create button on the subdomain form" src="__img3" />

You should see a confirmation.

<img alt="The success message confirming the subdomain was created" src="__img4" />

## Check it worked [#check-it-worked]

Request a subdomain you have never created:

```bash
curl -sI https://anything-at-all.example.com | head -n 1
```

It should reach your site rather than failing to resolve.

## Point it at your main site [#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 [#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](/en/hosting/wordpress/wordpress-multisite-subdomains).

## Wildcard SSL [#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](/en/security-ssl/how-do-i-install-a-wildcard-ssl-certificate-via-letsencrypt).

## Related [#related]

* [Create a subdomain in cPanel](/en/hosting/how-to-create-a-subdomain-in-cpanel)
* [WordPress Multisite subdomains](/en/hosting/wordpress/wordpress-multisite-subdomains)
