Naming your
HTML document Files

Previous page...

It is important to follow a few simple guidelines when name your html files.
  1. Use the .htm file extension. This is especially important if using Windows Notepad to save your plain text files to HTML. Notepad is a text editor and as such will always default to saving files with a .txt extension.
  2. Avoid using spaces in filenames. Although you may be used to using Windows applications which can handle long filenames, the web does not properly support them. A web server may be able to resolve the problem, by replacing the space with %20, but if you don't use them you can't be wrong.

    http://cablemodem/my/My%20WebSites/Runshaw/telematics/filenames.htm
  3. Try not to use meaningless filenames, such as 'myfile.htm'. Once you have a few documents in your website you will begin to have difficulty remembering what each one is!
  4. Do not use symbols, especially the ones which are part of the Operating System File structure.
    • : - colon
    • / - Forward slash
    • \ - Backslash
    • . - dot

What are acceptable filenames?

Try to make your filenames relatively descriptive, but don't go overboard!

For example contactdetails.htm could be a page with company or personal contact information such as address and telephone number etc.

If you find multiple words in filenames difficult to read and decipher, then you can use one of two conventions

  1. contactDetails.htm - Capitalise the first letter of each new word.
  2. contact_details.htm - Use an underscore _ between words.

Naming your Home Page

Remember do not use spaces!

Dependent on how a web server is set up your home page default filename should be one of the following:

default.htm, default.html, index.htm, index.html, home.htm, home.html, main.htm or main.html

These are the most popular, but other variants are possible. Check with the person who is hosting your web site when you come to publish it.

Back to Top of Page

© 2003 Ashley Preston 

Computeach International Ltd