| |
Naming Conventions
Deciding
what to name your Web files and folders can be an important part
of creating a cohesive Web site. The Web is not as flexible as most
desktop computer systems when it comes to file naming. Improperly
named files can, at best, be unwieldy and difficult for users to
decipher, and at worst, make it impossible for people to visit your
pages.
Here
are some things to avoid when naming files or folders for Web use:
- Spaces
(http://www.wsu.edu/my file.html)
- Periods
(dots) that do not immediately precede a file extension (http://www.wsu.edu/my.folder/my.file.html)
- Any
character that is not a letter, a number, a dash, or an underscore
(http://www.wsu.edu/my*site's#graphics/great!photo.gif)
Note
that although underscores are legal for Web addresses, some people
do not like them, because they are not as easy to type as other
characters. Some like underscores, on the presumption that a definite
separation of words will assist in search engine optimization. While
many use underscores to separate words (winter_wheat.html), you
can use a capitalization scheme for a similar effect (WinterWheat.html).
Whichever system you choose, remember that consistency is valued
in our highly mechanized and automated society. Do be aware that
Unix servers are case sensitive, so someone requesting "winterwheat.html"
will not be able to receive a file named "WinterWheat.html"
if your site is hosted on Unix. Make sure that your links are correctly
capitalized, and test all links after uploading your files! Also,
when linking, use the same capitalization scheme as the files even
if your Web server is not case sensitive. Inconsistency could result
in broken links if you ever change servers to Unix.
I use spaces on my file names, and they work just fine. So what's
the problem?
Web servers are typically able to interpret and deliver file
names with spaces. But this can cause confusion, as they may render
the file name not with spaces, but with alternate characters (see
sidebar). Also, other programs, such as email
programs, can automatically turn a Web address into a link. When
a Web address has a space, however, the program thinks the address
has stopped. See an example of this in this screen shot of an email
message:
So to avoid confusion, avoid spaces in file and folder
names.
Do
folder and file names affect my rank in search engines?
It is wise to presume that they can. Files should generally
be named for the content of that filewhether the file is an
HTML, PDF, or a graphic. This goes double for folders. But don't
use your file names for keyword packing. Brevity is as important
as relevance. "Apples.html" is a much better file name
than "Apples_apples_growing_apples_in_Washington_State.html."
If
your site, like the above example, is about apples, remember that
you don't need to use the word "apple" in every file name.
But keep file names relevant to the page contents: granny_smith.html,
macintosh.html, red_delicious.html, pests.html, harvest.html, markets.html.
Index
files
When asking for a directory (such as this site, http://caheinfo.wsu.edu/webtips/),
the server must decide which page to send. By default, servers
are
typically configured to send the file "index.html" (or
"index.htm"). So when you request http://caheinfo.wsu.edu/webtips/,
the server is actually delivering the file
http://caheinfo.wsu.edu/webtips/index.html. Try following these
two previous links. You receive the same page, right?
This
means that the home page or main HTML file for any directory should
be named "index.html" or "index.htm" (FrontPage
typically uses "Default.htm" as the home page; this is
also acceptable).
Suppose
I had named the home page "webtips.html" instead of "index.html."
What harm could this do? First, barring a server reconfiguration,
you could not use the address http://caheinfo.wsu.edu/webtips/ to
view the home page. You would need to use the address http://caheinfo.wsu.edu/webtips/webtips.html.
"So," you say, "I'll just put that longer address
in all my links." Sure, you can do that, but you've still violated
the "brevity" principle. You want the site address to
be easy for people to remember, easy and quick to type without error,
and easy to link to. The longer the name, the more difficult these
things are.
Additionally,
suppose you come to a page within a site, such as this page (http://caheinfo.wsu.edu/webtips/names.html).
To go to the home page, you can either search the page for the "HOME"
link (which may or may not be easy to find), or you can simply delete
the "names.html" file name and hit enter. Boom, you go
immediately to the home page, index.html (again, try this). A non-standard
home page file name will either give a directory listing (unfriendly
to site visitors), or an error, such as "You are not authorized
to view this page" or "Directory listing denied."
See what I mean here.
Must
I include an index page in every directory? No. Graphics folders
are obvious exceptions. There may also be cases where multiple directories
are helpful in organizing the site into different areas (as this
site does), but you don't really have a home page (or Table of Contents
page) for each folder. But if you do, then that TOC page should
be the index.html page for that folder.
Newsletters & Periodicals
If
you are posting newsletters or other periodicals on the Web,
whether in HTML, PDF, or Word format, it is best to organize
your
files numerically from the larger to smaller time unit (e.g., year,
month, day). Compare the following filenames, organized alphabetically:
|
|
Home pages
Newsletters & Periodicals
FYI:
Do you ever notice the characters %20 in a URL? This
results when the browser or server converts a space in a URL
into a code that is more universally understood by computers.
Net
Mechanic offers additional information on this topic. |
Have
a Web
question?
Ask
Bob
Hoffmann
|
|