Careers BNL home  

File Naming Conventions & Directory Structure

Directory ExampleFile and directory naming conventions are key to creating a well-organized site. Site organization provides many benefits, not the least of which is helping your visitors navigate your site.

Web users often try to guess or remember URLs. A consistent directory structure helps people to intuitively navigate.

For example:

If users are looking for news, try using http://www.bnl.gov/computer/help/, they are likely to try the same URL under web, e.g., http://www.bnl.gov/web/help/

When sites are well organized up front, directory and filenames are less likely to change down the road, avoiding broken links and bookmarks. Site managers benefit from an organized structure when it comes time to determine ownership of files and clean up directories in order to keep pages current. New managers can easily learn the structure with less difficulty. Consistent structure and well-named files help developers when performing maintenance. A well-organized site structure can help site managers get more out of their statistics packages by providing more specific reporting on subsections of data.

Goals

  • Encourage the use of clear and mnemonic filenames.
  • Promote a level of consistency in naming that will foster a relatively intuitive access to files and Web space.
  • Ease management and maintenance.

Guidelines

URLs must be as logical and clear as possible and make sense to people. Use unabbreviated words or common acronyms. They should be easy to remember and easy to spell: e.g., geothermal, not geothrm.

With that in mind, URLs should still be as short as possible: e.g., reimbursement, not reimbursement_account_deadline. Longer URLs are harder for people to remember and type and are often broken when sent through e-mail (An e-mail allows about 70 characters per line).

  • Make sure that HTML filenames end in the following extensions
        - .asp (when active server pages or Server Side Includes are in use)
        - .shtml or .shtm (when Server Side Includes are in use)
        - .html or .htm
  • The homepage of a directory or folder should always be named:
        - default.asp (when active server pages are in use)
        - index.shtml (when Server Side Includes are in use)
        - index.html or index.htm

    This allows for shorter URLs as users can "chop off" the filename and still get to the page (e.g. www.bnl.gov/ is the same as www.bnl.gov/default.asp)
  • Avoid overly general file and directory names (e.g., file1.html, file2.html). Filenames should be based on the page title.
  • Divide larger groups of files into subdirectories.

If you have several files in a directory called:
    - policy_lunch.html
    - policy_smoking.html
    - policy_sicktime.html

Move them into a subdirectory called <policy> and call them:
/policy/
     |------ lunch.html
     |------ smoking.html
     |------ sicktime.html

Please Note: URLs, filenames, and file extensions cannot contain spaces, or special characters (e.g., &, # or $), but may contain letters, numbers, underscores, and dashes. You may also use CamelCase notation (e.g. MixedCase.htm or mixedCase.htm). Make sure that file names clearly denote their content; do not use the DOS 8-and-3 naming convention.

Delete ALL Extraneous, non-linked (orphan) files. Web Authors should delete all extraneous files from the development server before asking to have your site published to the Production Server. Publishing, copies any new files or files that were changed to the production server. Publishing also removes any files from the production server that are no longer on the development server.

Top of Page

Last Modified: April 6, 2009