Wildcard subdomains can be used when you want to redirect all your visitors to your main website regardless of what subdomain they type in. It is also a requirement if you are setting up WordPress multisite with subdomains.

This is also useful if someone mistypes the www in your web address, for example ww.yourdomain.com.

Here is a guide to setting up your wildcard subdomain…

1. If your website uses cPanel, the easiest way to set up a wildcard subdomain is to create a new subdomain *.yourdomain.com. On the home screen, click subdomains and add the required info (see below).

You must make sure that the subdomain’s Document Root is public_html or the directory that your website resides in.

1. If your website uses cPanel and you have access to WHM, you can log in to WHM and go to Edit DNS Zone. Select the domain name you wish to add the wildcard subdomain to.

Then, under Add New Entries Below this Line you should fill in the fields so that they look similar to the following:

*                       14400            IN                     A               0.0.0.0

0.0.0.0 should be the IP of the account.

3. Another method used to enable wildcard subdomains is to edit the httpd.conf file. But to do this, you must have root access to the server.

Firstly, log in as root user and open the httpd.conf file (the file is commonly found in /etc/httpd/conf) with a text editor. Then find the VirtualHost entry. It should look like the following…


ServerAlias www.yourdomain.com
ServerAdmin webmaster@yourdomain.com
DocumentRoot /home/yourdoma/public_html/joe
ServerName yourdomain.com
User yourdoma
Group yourdoma
BytesLog /usr/local/apache/domlogs/yourdomain.com-bytes_log
CustomLog /usr/local/apache/domlogs/yourdomain.com combined
ScriptAlias /cgi-bin/ /home/yourdoma/public_html/joe/cgi-bin/

The only change you need to make is change:

ServerAlias www.yourdomain.com

to

ServerAlias *.yourdomain.com

Free Graphics, Icons, Tutorials
Free Graphics Free Christmas Vector Icon Graphics Pack 2017Free Fitness Vector Icons Graphics PackFree Camping Vector Graphics PackFree Summer Graphics PackFree File Icon PackFree Fast Food Vector Graphics
Sharing is caring...
Like & Follow
Share the love, share this page! Facebook Twitter Digg Reddit LinkedIn Pinterest Email
Close [X]
The Web Taylor
1000 Lakeside North Harbour Portsmouth, Hampshire PO6 3EN
02392 123358