Wildcard subdomains are used to redirect visitors to the “main” website even if they are trying to access a different subdomain. This is also useful if visitors mistype the www portion (e.g., ww.yourdomain.com).
Another situation in which wildcard subdomains are especially required is when using WordPress Network (formerly known as WordPress Multisite or WPMU) and wish for user’s blogs to look like user.yourdomain.com.
1. Navigate to cPanel > Subdomains and create a subdomain *.yourdomain.com. This is the simplest way.
Make sure that subdomain’s Document Root is public_html, otherwise this solution won’t work.
Remember to replace 123.123.123.123 with your actual server IP.
3. The third way you can enable wildcard submissions is to edit httpd.conf (Apache configuration file) directly. Keep in mind that in order to do this, you will need SSH root access.
Log in as root and access the httpd.conf file, usually located in /etc/httpd/conf. However, the path may be different depending on your Linux distro.
When you’re finished, restart Apache. Wildcard subdomains should work for yourdomain.com straightaway.