Contents |
Organizing Files | File Naming on the Web |
|
Here are the basics: People store an incredible number of files on computer disks! In order to organize these so they're not all jumbled together, "folders" or "directories" can be set up to put files in logical places. All computers use a hierarchical "tree" pattern for saving files in directories. (It's called a tree, but the "root" is at the top, so it's a very upside-down tree!)
Every disk has a "root directory" containing files and other directories. These subdirectories may contain other files and directories. How does this apply to the Web?
As you have noticed, directories and subdirectories in URLs are separated by forward-slashes / In addition, the directory one level up can be represented by two dots
.. and the current directory by a single dot . These can be used in creating
links, as we'll see now...
|
Each plan has its tradeoffs: |
|
|
In a simple Web site, the images are usually kept in the same directory as the HTML files. However, as Web sites grow, it becomes more difficult to keep track of the image files - especially if files from several directories want to refer to the same images. Many Web designers recommend creating a special image directory and putting all images there. I have found it generally simpler on my site to keep the images together
with the files they are used with. This results in some duplication, but
fewer directories. Oh well, it's yet another tradeoff!
|
|
In many organizations, one person is in charge of the Web site - or a specific part of it. Since you're reading this, let's assume that person is you! How should you get started with your Web site organization, and how should you maintain it once it's up and running? A good, practical way to do this is on your own computer is called "mirroring":
The advantage of using exactly the same directory names and file
structures in both places is that you can create relative
file links and have them work both on your own computer and on the
server.
|
Naming Files for the Web |
|
|---|---|
| When you give your Web pages a file name, the name becomes part of the URL and so must be acceptable on many different kinds of computers. Here are the rules, sprinkled with a few guidelines: | |
|
The home page can have any of these names:
A Web server is often given a URL with only a server name or a directory name, for example: www.wccnet.orgThe designers of the Web needed to give servers something to look for when this happens; so servers are programmed to look in the directory and give you any of these four files they can find. What if the server can't find any of these, but the directory exists? It's then programmed to give you a directory listing of the files in that directory; it's even linked so users can click on any listed file or directory and get it on their screen! But as a Web site designer, you will probably want to avoid giving your guests a directory list! It's rather like coming to an apartment building and finding a locked door with a row of labeled buttons to push. You hope someone is home! On the Web, it's much nicer to enter by a well-designed and attractive
home page!
|
|
|
No! Don't put spaces in your file names! Though some computers (Windows or Macintosh) allow spaces in file names, most Web servers are Unix-based. They let you store files with spaces in their names, but they don't find them when you look for them again! When you use conversion utilities you may find that Web files are created
with spaces in their names. For example, Microsoft Access
has a utility to convert database tables and reports into Web files. This
utility takes the names of Access tables, which can have spaces,
and simply converts them into file names. This can cause lots of trouble
if you're not cautious.
|
|
|
You can use alpha characters (abcdefghijklmnopqrstuvwxyz), numeric characters (0123456789), the dash - and the underscore _ but avoid any other special characters. |
|
|
Keep your names under about ten characters in length. You can usually get away with more, but it's better to keep it simple, and the longer it gets the more likely a computer somewhere on the Internet will choke! |
|
|
Most (but not all) Web servers are case-sensitive - that is, they consider the letter Capital A to be completely different from the small letter a. A good rule to follow is, always use only lower case letters in Web file names. This is part of the "Keep It Simple" principle. Caution: Capital letters can be a problem with MS Windows. Although Windows doesn't care about capitals vs. lowercase letters when it looks for files, it sometimes automatically capitalizes the first letter of a file's name when it saves the file for the first time! This can cause much frustration when you create links using lowercase letters. They work just fine when you test them on your Windows computer, but you find that on the server the links no longer work! To avoid this problem, check the names of Web files and graphics on your computer using Windows Explorer or My Computer. If you find a file with a capital letter, click the name twice slowly to edit it, and change the capitals to lower case. Once changed, they (generally) stay that way. |
|
About this document... |
|
|---|---|
| Review: click here. | |
Audience: |
For people who need to create files and put them on the Web in a logical, organized fashion. |
Objectives: |
When you successfully complete this lesson, you will
be able to...
|
Module W50c: |
This document is part of a modular instruction series in Computer Information Systems. For more information, see the overview or the list of modules in this series, W: World Wide Web. This document has been used in the following classes: CIS 260, INP 143. |
Author: |
Laurence J. Krieg |
Institution: |
|
| History: | Original: 29 Nov 1998
Last modification: Monday, 31-Aug-2009 11:48:06 EDT |
| Copyright: | Copyright © 1999, Laurence J. Krieg.
Instructors: You may point to this file in your Web-based materials. Students: you may make a copy for your personal use. All other uses: contact the author, Laurence J. Krieg for permission. Email krieg@ieee.org |