Sunday, December 23, 2007

SubDomains What are they and why Use them?

SubDomains- What are they and why Use them?

 
 

Subdomains allow you to divide your domain name/website into sections or separate areas.

 As an analogy if you go to any medium to large company office you will see it divided into various departments like accounts, sales, product development. People who work in these various departments are all located near to each other maybe on the same floor or office section.

You can do the same with your website. If you have a medium/large company you may want to have a separate website for the sales, and another for the Marketing side. Rather then having totally separate websites you can section or divide your main website just as you would a normal office.

There are two main methods used:

  • Use separate folders
  • Use Sub domains

Using Separate Folders to Sub Divide a Web Site

This is the most common method and is easy to implement on almost all websites. Here the main domain name is abc.com. to access the website you type in http://www.abc.com or http://abc.com (not always possible). When you do that you get the index.htm file showed circled in yellow (below) for that website.

You can now create folders underneath the main site (here sales and MTG) and each folder will contain files relevant to that department. You can tell you sales customers to access the this folder by giving them the URL of the folder: http://www.abc.com/sales or http://www.abc.com/mtg.

Here when the visitor types
http://www.abc.com/sales
into his browser he gets the home page for that folder - the index.htm file circled in red below.


Note: It is normal and desirable, but not compulsory, to create a home page for each folder such that when someone enters the site using the folder name and not a web page they get the default web page of that folder (folder home page).

Using Sub Domains

In the above examples you can see how easy it was to section the website. The only problem with this form of sectioning is that the URL that you need to give your customers is not what most web users are used to seeing.

To get a more easy to remember URL you need to create subdomains. In our case our domain name is abc.com and a subdomain would look like this: subdomainname.abc.com e.g. sales.abc.com or mtg.abc.com.

Now all we need to do is to associate the sub domain names with their bit of web space. To do this you again create folders but this time you associate each folder with its own domain name as show below:


Now when the visitor types http://sales.abc.com he gets the index.htm file shown circled in red. It is also possible to use the full address http://www.sales.abc.com and get the same file.

No comments: