Skip to content

How to create a Wildcard subdomain in cPanel?

Last update: 08/Apr/2024

VERY IMPORTANT: Wildcard subdomain is supported on cPanel, aaPanel, and some other web hosting panels. Please check with your hosting provider or web hosting panel support. It does not work in hPanel.

Official Namecheap Guide

Note:
After adding the wildcard subdomain to DNS, go to .env and enter SUB_DOMAIN and MAIN_DOMAIN in your domain URL (do not use http or https).

Example:

SUB_DOMAIN=www

MAIN_DOMAIN=domain.com (Use your domain instead of "domain")

If you're using a script on a subdomain, go to .env and enter SUB_DOMAIN and MAIN_DOMAIN in your domain URL (do not use http or https).

Example:

SUB_DOMAIN=subdomain (Use your subdomain instead of "subdomain")

MAIN_DOMAIN=domain.com (Use your domain instead of "domain")

© 2019-present NativeCode. All rights reserved.