On a home computer, you can name your files and folders almost whatever you want, but you have to be much more careful about file names on web servers.

If you don’t follow these rules, you’ll probably still be able to open your files on the web. Or maybe you won’t. Or maybe you’ll be able to open your files for a while, but they’ll act weird or get corrupted. Probably better to just follow these rules.

RULES

 

  • File names must only contain letters and numbers.
    The only other characters you should use are dash – and underscore _

    BAD: My Stuff (for class).html
    BAD: my*stuff/class.html
    GOOD: my_stuff-for_class.html

  •  

  • Do not use any extended characters in file names.
    No tildes, no umlauts, no accents, no icelandic thorns

    BAD: Günter's El Niño Page.html
    GOOD: gunters_el_nino_page.html

  •  

  • Do not put any blank spaces in your file names.
    Remove all blank spaces, or replace them with dash or underscore.

    BAD: my happy file.html
    GOOD: my-hapy-file.html

  •  

  • Only use lower case letters in file names.
    Some systems are case sensitive and see capital letters as different. Some are case-insensitive and will see capital and lower case as the exact same letter.

    BAD: ToTallY-AwEsOmE-StUfF.html
    GOOD: totally-awesome-stuff.html

  •  

  • File names should begin with a letter.
    Names that start with any other characters can cause strange things to happen.

    BAD: _filename.html
    GOOD: file_name.html

  •  

  • Keep file names as short as possible
    (But keep the name meaningful).

    BAD: If only I knew what to name this file for class on the 23rd of February of 2006, but I do not.html
    GOOD: class_file-2006-02-23.html

  •  

    TIPS and GUIDELINES

  • The home page of each directory — and therefore the home page of your web site, is called: index.html (Some web editing programs try to use names like “Default.htm” which is kind of sad, really.)
  •  

  • File names are fairly important to search engines. image290.jpg doesn’t contain any useful information. However hot-puppy-image290.jpg will get the attention of the search bots.
  •  

  • If you want to put dates in your file names, it’s best to name them numerically, ordered from the largest to the smallest time unit. For example for a file posted on Feb 23, 2006: file_name-2006-02-23.html