How to Create a Wildcard Subdomain?

47. How to create a wildcard subdomain

End users of a domain-based WordPress multisite network can create new sites on demand with the help of Wildcard subdomains. In this kind of network each new site has its own subdomain, and the wildcard configuration means that the subdomains shouldn’t be configured individually.

I’ll give you some examples of how to configure wildcard subdomains in different circumstances. If you don’t know how to set up wildcard subdomains on your particular web server, you should contact your webhost for directions.

In the httpd.conf file, or in the include file that contains the VirtualHost section for your web account, add a line like this:

ServerAlias *

You can also create a wildcard DNS record like this:

* A

You can make a sub-domain named “*” (wildcard) at your CPanel (* Just insure to point this at the same folder location where your wp-config.php file is.

There are some steps which differ when setting up the server for wildcard subdomains on a server using Plesk Panel in comparison with a server using cPanel.

For Direct Admin Panel, click “User Panel” -> DNS Management -> and add the following three entries using the three columns:

* A

You should replace “” with your website IP.

Click “Admin Panel”  -> Custom Httpd -> -> In the text input area, just paste and “save” precisely the following:

ServerAlias *.|DOMAIN|

AWS (Amazon Web Services) instances are not assigned a permanent IP address by default. That is to say that a “server’s” IP address may change when it’s rebooted. To resolve this problem, you should assign an Elastic IP Address to your server instance and use that IP address when configuring the A record with your registrar.

AWS Elastic Load Balancers can’t be assigned an elastic IP, hence you must use a CName to give them a friendly URL. You can’t have a CName to a root URL. You must point the domain root at a specific server instance with an Elastic IP address and create a wildcard CName (* and point that at your Elastic Load Balancer. In your .htaccess, just redirect all domain root traffic ( to a specific sub-domain (

Share this!

Leave a Comment

Your email address will not be published. Required fields are marked *