|
Design Tip:
Structure Directories For Easy Maintenance
by Larisa Thomason,
Senior Web Analyst,
NetMechanic, Inc.
Imagine a document filing system where you take every invoice, paycheck stub, and receipt and toss it into a filing cabinet drawer with no file folders or organization system. Then try to do your taxes. Ok, so some people really handle their finances like that, but don't treat your Web site the same way! Web sites organized in a logical, coherent directory structure are much easier to update and maintain.
Unstructured Sites Get Unmanageable
When you think about structuring a Web site, you're usually considering it from a user's perspective: navigation trees, accessible navigation, etc. But consider site structure from a designer's perspective and you'll soon realize what a pain an unstructured site can be.
By unstructured, we mean a site where a careless designer dumps every file - images, html files, external files, and scripts - into the top-level directory.
With this type of structure - or lack thereof - a simple 10-page Web site could easily have 100 files in the top-level directory. With each update that adds several new images or a new page, the jumble of files gets larger. Eventually they get out of control.
What happens then?
- You waste time looking for the correct image file to include on your new page. The search is easier if you're careful about file names.
- You spend hours trying to debug a page - only to find that you got confused and attached the wrong external CSS or JS file to it.
- You try to clean up the file mess and accidentally delete files still in use.
|
Let's look at a basic directory structure that can help you tame your files.
Basic Directory Structure
Think about the major categories of files in your site: HTML, CGI scripts, images, external CSS and/or JavaScript files. Then create a directory structure that places each file into its proper category.
Here's a simplified example:
Note that the main pages in the site - index, AboutUs, and Products - are the only ones in the top-level directory. The other files are placed in their proper folder. Each folder has a descriptive name that clearly identifies the types of files it contains.
Advanced Directory Structure
That basic design will work fine for a small site that doesn't change often, but what if your site is more complex? You may need to add a few more subdirectories or place some subdirectories under existing subdirectories.
Let's imagine a community organization that maintains a fairly large Web site because they use it to communicate with volunteers, recruit new volunteers, and publicize events. Their site contains general information, pictures from different events, and an archive of online newsletters. Even with a basic directory structure, the site's size could quickly get out of control, so the webmaster set up a few more directories:
Note that the images file has subdirectories whose names indicate which event the images are from. The newsletters are also archived in different folders. The current year's issues are in the main newsletter directory, but old ones are filed according to year. That may seem overly complicated when you imagine trying to type the file path into your code, but it pays off later.
As you add photographs of meeting, fundraisers, events, etc. it quickly gets hard to sort out which picture is from what event. Sorting files by date may help some, but what about months with multiple events? Or what if the webmaster updates monthly and all the files have the same date?
But when images from each event reside in their own directory, it's a snap to delete the directory once you no longer need to display the images.
Take this same technique and extend it to news stories or whatever types of information contained on your site. The expanded directory structure is easier to maintain; it also makes life much simpler should someone else take over site maintenance!
Directories And Web Site Promotion
Now that we've counseled you to create a lot of directories and subdirectories… we're going to warn you to be careful! A Web page's place in the directory structure can affect how a search engine algorithm scores the content.
Always place your most important content on the first few levels of your site - preferably in your top-level directory. Some search engine algorithms assume that content closer to the top is more important. So make sure that the pages in the top level reinforce your site's overall theme and include your most important keywords.
Other promotional concerns include:
- Splash pages: A splash page usually offers little content, but pushes all the other pages down one level. Never submit a splash page to a search engine.
- Directory and file names: Whenever possible, use descriptive directory and file names that contain your site's keywords. Image file names are particularly important because many search engines now allow visitors to search for images and return results based on the file names.
- Deep submit pages: You can't be sure that search engine spiders will reach every page in your site, so submit all your important content pages - not just your home page. This technique is called deep submit.
|
After you've evaluated and reorganized your site, be sure to test it thoroughly. Whenever you move files to a new directory, you need to update the file paths in the HREF tags. Otherwise you could end up with a Web site full of broken links. Avoid the hassle of checking every link by hand with NetMechanic's HTML Toolbox. It includes an automated tool that checks your links and alerts you to broken internal and external links.
|