Bob Hoffmann's Web Tips  

HTML, etc.
Dreamweaver Tips
Contribute Tips
Miscellaneous Tips
Search Engine Tips

CAHE Information Department

WSU Google Search:


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 (  file.html)
  • Periods (dots) that do not immediately precede a file extension (
  • Any character that is not a letter, a number, a dash, or an underscore (*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:

Screen shot: Broken auto-link

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 file–whether 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,, 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, the server is actually delivering the file 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 to view the home page. You would need to use the address "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 ( 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

Have a Web
Ask Bob Hoffmann




Note that while both lists are sorted alphabetically, only the second list is sorted chronologically as well. This makes it much easier to find a specific edition or range of editions when you are performing site maintenance. It is also a much easier system to use consistently. Note in the first list, February 2004 actually precedes February 2003, because the February 2004 file name is abbreviated.

Refer questions or comments to Bob Hoffmann, 509-335-7744. Accessibility | Copyright | Policies
CAHNRS Information Department, 401 Hulbert Hall, Washington State University, Pullman, Washington, 99164-6244.