Note: This only applies to customers on server host1.internetguruhosting.net
There is no automatic create a sub domain function on our control panels, so you have to do it manually. It is a little tricky, but once you get the hang it it is pretty simple.
Stage 1
First you need to create a DNS entry for the sub-domain. We do this by creating a CNAME pointing to your domain.
. login to webmin (https://host1.internetguruhosting.net:10000/)
. Select Servers from the left menu
. Select BIND DNS Server
. Select your DNS zone (amacpl.com.au)
. Select Name Alias
. Put your sub domain in to the Name fields and your domain name into the Real Name field. Make sure the domainname has a full stop at the end.
For example to create the usage.amacpl.com.au subdomain use
Name: usage
Real Name: amacpl.com.au. (note the full stop at the end)
. Select Create, then Return to zone list
. Select Apply Changes (though the secondary DNS will eventually refresh you can also do Apply Changes on: if you want to speed up the domain transfer)
Take care when playing with DNS settings as a misconfigured record can make your website disappear.
Stage 2
You have to setup a server rewrite configuration that redirects requests for the subdomain to the subdomain folder. This script sits in the root folder of your site in a file called .htaccess .
. Login to Usermin (https://host1.internetguruhosting.net:20000/)
. Select the Applications tab.
. Select Apache Options Files
. enter /home/<your domain>/html into the Add options for: field and select Add options for: This will create the .htaccess file and throw you in to the configuration screen for this file (You only need perform step 4 once. On return visits you should get a clickable link reading /home/<your domain>/html
. select Edit Directives and paste in
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} subdomain.domain.com
RewriteCond %{REQUEST_URI} !subdomain/
RewriteRule ^(.*)$ subdomain/$1 [L]
and press Save
(to add additional sub domains repeat the last 3 lines – don’t forget to add it to your DNS first)
RewriteCond %{HTTP_HOST} newsub.domain.com
RewriteCond %{REQUEST_URI} !newsub/
RewriteRule ^(.*)$ newsub/$1 [L]
)
That should do it . It may take some time for the DNS change to filter through the net, so don’t worry if it doesn’t work straight away.
If your site does disappear then you’ve messed up the DNS. If you get a different site then there may be a problem with the .htaccess file,