A subdomain is a separate part of your website. Your domain name is the address you registered when you first set up website hosting. A subdomain is then simply anything you place before the first (dot) in the web address. The most common subdomain in use is www, although you can create other subdomains, like news in the example below.
Subdomains are most commonly used when you wish to create a clearly separate part of your website for a specific purpose. For example, Wikipedia use en.wikipedia.org to clearly indicate the English language area of their large website, and then use different subdomains (for example, de.wikipedia.org) for other languages.
Within the Domain Name System, each subdomain is effectively a completely separate area of your website. It is not a webpage.
How do I create a new subdomain?
To add a new subdomain to your Gradwell hosting account, login to your hosting control panel. In the left hand menu, look for the Web Hosting area.
Click on Unix Hosting, and then Add virtual host. A virtual host is simply a section of our server that we place your website on.
In the Sub-domain field type your chosen subdomain (for example, news). There is no need to add your whole domain - just write what you want the subdomain to be called. Click Add virtual host and after around 15 minutes your new subdomain should be ready to use.
How do I upload content to my subdomain?
You can use FTP to upload content to your subdomain. For more help in doing this, please view this help article. Once you have connected via FTP, simply click on the webs folder to access your subdomains.
This area of the article is intended to give a more in-depth guide to this page of the control panel.
On the Add virtual host page the following fields can be found:
- Sub-domain: this is the part before you domain name, for example www. Some websites will also have sub-domains such as news., and this is technically a separate part of your website. When you start out, you are likely to just want to configure the www. sub-domain
- Domain: if you have more than one domain name registered with us, select the one you wish to configure from this dropdown box
- PHP version: select the PHP version that you wish to use for your website. We recommend using PHP 5.2, and this is selected by default
- General settings: the htdocs directory and log directory will update automatically depending on the sub-domain you enter at the top of the page, and we recommend that you don’t change these
The final configuration you can make if you wish is to setup a redirect. A redirect will tell a web browser to go to a different website when a user goes to a web address. This website can be entered into the Redirect URL field. You will need to choose a Redirection type from the dropdown box:
- Frames based redirect: this redirect will send a user to a different website, but your domain name will remain in the address bar
- Htaccess: this type of redirect simply sends a user to the alternative website, and the alternative website’s domain name will appear in the address bar
As a worked example for setting up a virtual host, if you purchased the domain name myyellowbox.co.uk and wanted to simply configure hosting for www.myyellowbox.co.uk, the page would look like this:
Any changes you make will take up to 15 minutes to take effect, so don’t worry if your web space doesn’t appear to be available immediately.
The walkthrough video below will show all of these steps in more detail.