When you want to redirect all visitors to your main website regardless of the subdomain through which they access your website, Wildcard subdomains play a key role.
Simply speaking, when a wildcard subdomain is used to access your site either via ww.yourdomain.com or wwwwww.yourdomain.com, it won’t matter at all. This means that they will still be taken to the home page.
To create a Wildcard subdomain, follow the below steps:
• Log in to cPanel.
• Navigate to Subdomains.
• Type in * in the “subdomain” field.
• Select yourdomain.com from the drop-down list.
• Ensure that you select the same Document Root for the Wildcard subdomain as the one for yourdomain.com.
So, your wildcard subdomain will be *.yourdomain.com and will have the same Directory Root (if it isn’t defined otherwise) as yourdomain.com.