| CREATE A SUB-DOMAIN |
A Sub Domain is a shortcut path name that points (redirects/links) to a folder or sub-folder within your public_html (website) folder. For example. If I
have a folder called music with a sub-folder inside it called classical with a sub-folder inside that called beethoven, so music/classical/beethoven,
within my Public_HTML folder you would normally type http://www.websitecreationhelp.com/music/classical/beethoven into your web browser's Address Bar
edit box to get to the beethoven folder, whereas if I have a sub domain for the beethoven folder you can type http://www.beethoven.websitecreationhelp.com
instead.
The above is possible because when you create a sub domain (i.e. http://www.beethoven.websitecreationhelp.com) you also set up a Redirection for it
(http://www.websitecreationhelp.com/music/classical/beethoven). This makes redirection flexible because you can switch between folders. For example.
Always keep the sub domain the same (i.e. http://www.music.websitecreationhelp.com) but change the redirection whenever you need to (i.e. one week
http://www.websitecreationhelp.com/music/classical/beethoven and another week http://www.websitecreationhelp.com/music/rock/therollingstones) - That
way your visitors only have to remember the music sub domain, irrelevant to what it is being redirected to each week.
To create a sub domain first login to your website's Control Panel and then
find and click on the SUBDOMAINS link to open the Sub Domain control panel (Fig 1.1).
When the Sub Domain control panel opens you will have two empty boxes, SUBDOMAIN and DOCUMENT ROOT, that make up the Sub Domain. The SUBDOMAIN edit box
needs filling in with the name of your sub domain folder. In this example music. When you do this and then click inside the DOCUMENT ROOT edit box
it is automatically filled in for you with the document root details. In this example with the path name of the sub domain folder, which is made up of
public_html and /music.
At this time only the sub domain will exist when you click on the CREATE button, the redirection will need setting up after that. If the sub domain folder
does not exist it will be created for you, but if it does exist that original folder will be used and not overwritten. So in this example I clicked on
the CREATE button to create the music folder (because it does not exist) and the sub domain http://www.music.websitecreationhelp.com.
After clicking on the CREATE button (Fig 1.1 above) you are given confirmation that the sub domain was set up successfully (Fig 1.2 above). Click on its GO BACK link to go back to the sub domain creation page and then click on the MANAGE REDIRECTION link in the Modify A Subdomain section (at the bottom of that page).
Clicking on the MANAGE REDIRECTION link will bring you to the Subdomain Redirection page (above) where you then set up redirection for your newly created
subdomain. There is only one edit box to fill in and it requires the URL (path name) to the actual folder you want the subdomain pointing
(redirecting/linking) to. In this example I typed http://www.websitecreationhelp.com/music/pop/bands/new before clicking on the SAVE button to continue.
If you want to redirect to an index web page within the folder (i.e. index.html) you must put a forward slash / at the end of the URL. In this
example I am redirecting the subdomain to a folder called new (http://www.websitecreationhelp.com/music/pop/bands/new) but if I wanted to redirect
it to an index web page I would fill the edit box with http://www.websitecreationhelp.com/music/pop/bands/new/. This would then display the index
(i.e. index.html) web page inside the new folder instead of displaying the content (folders/files) inside the new folder. For this to work though you
must have an index web page (or file such as index.php) inside that folder otherwise its content will be displayed instead.
After clicking on the SAVE button (Fig 1.4 above) you will receive the standard confirmation notice (Fig 1.5 above) to state you have successfully set up the redirection for your subdomain. Click on its GO BACK link to take you back to the subdomain creation page where you can then set up another subdomain and modify or remove an existing subdomain.
Subdomains are ideal for shortening very long URLs (path names) but not really ideal for http://www.music.com/new. In this case it would be just as easy (non-lazy) to type www.music.com/new as it would be to type www.new.music.com - The same number of characters.
All HTM, CSS, PHP and MySQL files in the websitecreationhelp.com folder and its sub-folders are (c) John White, 2009. All Rights Reserved. Email: John