Continued from page 1
This arangement of directories and sub-directories will provide good file organization for example website. Understanding my reasoning for this directory structure should help you to design a directory structure for website you have in mind.
Default Page Configuration
Every website has at least one default webpage configured (also called "home" page). The default webpage is webpage that is returned when user enters or clicks on a link containing only domain name, without a specific file name. On a Unix or Linux web server, default webpage will usually be "index.htm". On a Windows web server (IIS), default page will usually be "default.asp".
The website administrator, or if your webhost provides required "control panel" feature, you can actually configure any page to be default page. If your web server has more than one default page configured, I would recommend removing all but default page that you intend to use.
Now, let's assume that all of your webpages need to link to an image file named "logo.gif" stored in "common" folder. The relative link on your default webpage would be as shown below.
The website file manager interprets this as "look in folder named common for file named logo.gif".
However, link on any webpage contained in one of sub-directories would be as shown below.
The website file manager interprets this as "go up one level, then look down in folder named common for file named logo.gif".
This difference in link may not be a problem unless you use SSI or ASP (Active Server Pages) to build your webpages from a common header file and a common footer file. Then you need a different link in common file depending upon whether page linked to common file is default webpage (where you would use common/filename) or a webpage contained in a sub-directory (where you would use ../common/filename). There are several ways to solve this problem.
1. If your website has a server-side scripting engine like ASP or PHP and you know how to program, you could implement code that selects proper link. 2. You could use complete path, including domain name, on all pages. This will cause problems if you ever have to move your website to a different web host (Until all dns servers across planet have been updated).
3. You could put your home page in a sub-directory, for example "common", and make your default page into a re-direct to your home page. Then you would use "../common/filename" for all links. The following meta tag, placed head section of your default webpage, will immediately redirect users browser to your real home page.
meta http-equiv="refresh" content="0,url= "http://yourdomain.com/common/homepage.htm"
In this article, I showed you how to design a directory structure for your website and how to create relative links to link all your webpages together to form a website. Website visitors don't like to do a lot of scrolling, so try to keep your webpages to only two or three screens high. Please, no more websites that consist of only one mile long webpage!
---------------------------------------------------------- Resource Box: Copyright(C) Bucaro TecHelp. To learn how to maintain your computer and use it more effectively to design a Web site and make money on Web visit bucarotechelp.com To subscribe to Bucaro TecHelp Newsletter visit http://bucarotechelp.com/search/000800.asp ----------------------------------------------------------
To learn how to maintain your computer and use it more effectively to design a Web site and make money on the Web visit bucarotechelp.com To subscribe to Bucaro TecHelp Newsletter visit http://bucarotechelp.com/search/000800.asp