Motive [Home].Guides.

Guides

Naming website folders and files

The naming of folders and files is a small detail that can make all the difference when maintaining a website.

Here are a few recommendations for naming folders and files, including HTML files (webpages), image files, and PDF and Word documents.

Guiding principles

Recommendations

  1. Skip this menu
  2. Use natural language to name folders and files.
  3. Typeset all file and folder names in lowercase.
  4. Only use the lowercase characters [a-z], the numbers [0-9] and the hyphen character [-] in folder and file names.
  5. Use a hyphen/dash between words.
  6. Use standard file extensions.
  7. Use prefixes and suffixes to help identify and group related files.

1. Use natural language to name folders and files.

Natural language is everyday, conversational, and usually descriptive language.

If a folder or file name can easily be read and understood, both by your co-workers and your parents, then it’s probably natural language.
If a name look like it’s written in Klingon, or bears a striking resemblance to the the title of an Aphex Twin track, then you’re in trouble…

Rationale

2. Typeset all file and folder names in lowercase.

For example:

The folder containing the About Us pages:
/about-us/
The Corporate History page/file:
corporate-history.html
A photo of the company mascot:
company-mascot.jpg

Rationale

3. Only use the lowercase characters [a-z], the numbers [0-9] and the hyphen character [-] in folder and file names.

/multiple-word-folder/
multiple-word-file.html
080917-press-release.doc

Rationale

4. Use a hyphen/dash between words.

Use a hyphen/dash between words, rather than a space or underscore. For example:

2008-application-form.pdf

Rationale

5. Use standard file extensions.

Standard file extensions are those that are recognised by most web servers and web browsers.

Common web file types and extensions
File type Typical use Extension
HTML document (webpage) HTML code / webpage .html, .htm
JPEG photos .jpg
GIF graphical images, such as logos, graphs and charts .gif
PNG graphical images, such as logos, graphs and charts (similar, but superior to GIF) .png
Portable Document Format (PDF) documents, e-books, product catalogues (non-editable) .pdf
Word / word-processing document application forms, checklists, reports (editable) .doc

Rationale

6. Use prefixes and suffixes to help identify and group related files.

In addition to file extensions, file names can be used to differentiate between similar, related files, and also help when relocating files.

For example, date-based content pages, such as blog postings and media releases, often use the date as a prefix.
A blog entry might use the date (in the example below, the 19th Sept 2008) in the structure of the URL:

www.example.blogger.com/2008/09/19/name-of-blog-posting/

A media release (in Word format) might use the date as a prefix:

080919-product-launch.doc

The large and small (thumbnail) versions of the same photo;

wedding-reception.jpg (large version)
wedding-reception-th.jpg (thumbnail)

In the example above, the ‘-th’ is preferable as a suffix, as it will enable you to group the large and thumbnail versions of the same files through the file manager.
For example, if files are ordered alphabetically:

arrival.jpg
arrival-th.jpg
banquet.jpg
banquet-th.jpg
wedding-reception.jpg
wedding-reception-th.jpg

Rationale