WebGee Docsالتوثيق
cPanel & Hosting

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

  1. In cPanel, open Subdomains under Domains.

    The Subdomains entry in the cPanel Domains section

  2. In Subdomain, enter a single asterisk: *

    The Subdomain field containing an asterisk

  3. Choose the domain it applies to.

    The domain selector

  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.

    The Create button on the subdomain form

You should see a confirmation.

The success message confirming the subdomain was created

Check it worked

Request a subdomain you have never created:

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

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.

On this page