Naming Your HTML  Files
By Dr John Flynn
xerostar@iinet.net.au

The Problem:
When creating a large number of html pages for a web site or for an e-book that must be linked in a sequence, you need to have some way of naming the files to maintain logical order and control. When you have a large number of html files in one directory you can easily lose track of the order in which your pages appear if they just have simple names.
You can end up with missing pages and others appearing out of sequence. Believe me, you can finish up with an awful muddle trying to sort out the links from one page to another!

The Solution:
Numbers
You will need to use file names beginning with a number. My method is to use a number starting at 000 running through to 999 in front of a more descriptive name for the file. It's no use using a plain number e.g. 0 through to 999 because they will not appear in the correct sequence.

Characters
If characters are used first in the name, then the order of your list of HTML files will be alphabetical. If the names are to be descriptive of each file, then the resulting sequence will be anything but orderly.

Description 
The Front Cover of an eBook can be named "000FrontCover.html"  or better is "000_front_cover.html". 
The underscore helps to keep the description clear.
Look at: "070OldTimer.html"  - not clear at all. The zeros and upper case 'O" can be confused.
Better is 070_Old_Timer.html.
The combination e.g. "034_river.html" will show that the page belongs in position "34" and the theme has something to do with a "river". This method will allow up to 999 files which should be enough for most writers of eBooks or web pages.  If not, just add another zero !

The 3 Elements of a Good HTMLFile Name
With experience, I have found the best name for a html file has 3 main elements:
For example: 034StoryMagician.html  or
             034_Story_Magician.html

a) The numerical first part = 034 (for a series up to 999 pages)
b) The generic name of the series = Story
c) The subject of the file in one word = Magician

The numerical first part ensures that the file will be displayed in it's correct logical position in the series.

The generic name shows where the file has it's origin - this can be the same as the directory name. In this case "The Story".

The subject can be any word that reminds you of the content of that page. In this case the html page featured a Magician.
 

Inserting New Pages
If, as often happens, you need to insert another page "in between" at a later stage, when the project is all but finished, then I suggest appending an upper case letter after the number. 
e.g. 034A_river.html,  034B_river.html,  034C_river.html  etc. 
When the list is viewed in the directory, all files will appear in their correct order. The number of insertions can be expanded from 26 (A-Z) by using an additional character to a possible 676 insertions.
e.g.  034A_river.html. The next file in sequence will be 034AA_river.html The next file will be 034AB_river.html etc.
The underscore helps to keep the description clear and easy to read. The upper case letter at the end of the description stands out and does not spoil the description unduely. 
eg.  "034b_river.html" is not as clear as "034B_River.html. 

All Lower Case?
Some people insist on keeping all file names in lower case - that's OK too. eg. "034b_river.html".  The idea being to avoid mistakes arising while copying the file name. This is a matter of personal taste in my opinion. The important point is to have a system, and stick to it!

Never leave Spaces
HTML file names are more often than not, used as hyperlinks.
Never leave spaces in the file names or the links will not work properly. When the link is interpreted it will appear with a percentage character in place of the space and looks untidy. 
e.g. 034%B%river%.html which is also difficult to read.

Dispense with Descriptions?
You can dispense with the description element altogether 
e.g.. "034b.html"
This is not advisable as the file names are not always easy to distinguish at first glance, nor can you identify any "story" sequence, which is very important when inserting new pages into the "correct" position of a story or series of articles. Have a description there as well, it's good insurance and helps you to quickly identify the file you need from a long list.
Having a two word description can help to easily identify a file that gets misplaced in another directory.

Web Pages
When naming your web pages, for the best possible results from search engines, your page names should reflect major keywords from your web pages. If you separate the words with a hyphen or underscore, search engines will read the description as two distinct words.
e.g.   034-large-rivers.html will be read as "034 large rivers" whereas, 034largerivers.html will be read as a non-existant word.
Having non-existant words in your html page names will lessen your chances of scoring a high position in search engine directories.

Conclusion
You may have found this article somewhat pedantic in analysing something as simple as the name of an html file.
However in order to make some sense out of the chaos, by applying the rules wisely, you can make life easier for yourself.

**************************************************************

Dr John Flynn publishes a monthly HTML ezine called:
"The Xerostar Times" and his motto is:
"caring for creative people"
You can subscribe at: 
http://www.xerotron.com/cgi-bin/mail/mail.cgi
The free eBook "The Xerotron Story" is available at:
http://midi-ebooks.com  mailto: xerostar@iinet.net.au

***************************************************************

Return to Index
Copyright © 2001
Contact - webmaster@xerostar-times.com
Xerostar Holdings  22 Trelion Place Rivervale 6103
Western Australia Tel: 618 9479 1979