Skip to content | Change text size
 

File and directory names

The address of a web page is determined by it's file name (eg. file-names.html) and the directories it lives under (eg. /staff/web/pages/). To ensure these addresses are easy to use and remember, follow these naming conventions.

Use whole words or common abbreviations

Use whole words in file and directory names where possible, and when using abbreviations, only use those that are widely known.

It is much easier for a user to remember, to read out (on the phone to a friend, over a desk to a colleague), or to type in a web address where whole words are used.

Users who attempt to locate information by guessing web addresses will be more likely to find information on your site if you use whole word file names or common abbreviations.

Using appropriate whole word names also makes site maintenance easier. A file named privacy.html in a directory named policies can be readily identified as the policy document on privacy for your organisation.

Use all lower case characters

File and directory names must use lower-case characters. As most web servers are case-sensitive, if users get the case wrong they won't find the page.

Combinations of upper-case and lower-case characters in file and directory names are also more difficult to type and to remember.

Do not use spaces or non alpha-numeric characters

Never use spaces or non alpha-numeric characters in your file or directory names. They are not legal characters in web addresses and will be converted to their hexadecimal equivalent with a preceding percentage sign (%). This results in URLs web addresses that are difficult to type and remember. Some older browsers cannot access URLs web addresses containing hexadecimal these values.

For example, a file named my holiday.html in a directory named travel info would be translated to travel%20info/my%20holiday.html

Do not use underscores - use a hyphen instead

If you must use a character to separate two words in a file or directory name, use a hyphen rather than an underscore. When web addresses are formatted as links (i.e. as underlined text), underscores cannot be seen and users may think there is a space in the address. The image below shows how the underscore in a hyperlink cannot be seen in a Word document.

Screenshot showing a Word document with a hyperlink

Underscores also require two keystrokes (Shift key, plus the hyphen key), whereas a hyphen requires only one.

Use index files in all content directories

When http://www.monash.edu/students/ is entered as a web address, the Monash University web server sends the index.html file from within the students directory to the user's browser. This means that all directories on the web server must have an index.html file within them. If not present the web server will show a listing of all the files contained within that folder.

The default file that is sent to the browser is sometimes customised to default.html or welcome.html, please check with your web server administrator.

Using the default index file name means you can use shorter web addresses: http://monash.edu.au/students/ instead of http://monash.edu.au/students/index.html.

Standard file and directory names

The generic templates are based on a set of standard file and directory names. These should be used when the templates are customised. The standard names include:

  • a directory called assets which includes sub-directories called includes, images, errors, and optionally styles and scripts
  • headers, footers and other page elements included in a web page via a server side include should be kept in the assets/includes directory
  • all files included via server side includes should use the file extension .shtml
  • images should be kept in the assets/images directory
  • error messages should be kept in the assets/errors directory
  • if you are using a local stylesheet, it should be kept in the assets/styles directory
  • the assets/scripts directory should include all scripts except CGI scripts which should sit in a centrally-maintained cgi-bin directory
  • the sitemap should reside in your home directory and be named sitemap.html
  • if you have an alphabetical index of pages on your site it should reside in your home directory and be named a-z.html
  • all html pages (except those included via server side includes) should be use the file extension .html not .htm.

Resources