Printed from TeacherJohn.com • http://teacherjohn.com/tutorials/filenaming.php

How to Name Files and Directories

Note that in this tutorial we are talking about file names (the name you give a file when you save the file), not the text in HTML titles.

Because you usually put your Web files on a Unix server; Unix file and directory (folder) naming conventions apply. This means that file and directory names can contain only the following:

In other words, no other punctuation, no special characters, and NO SPACES. Let me say this again: NO SPACES in file or directory names. Additionally:

Home pages

Home page files are always named "index.html" (or, if the page uses PHP, it can be named "index.php"). The home page for your entire Web site is a file named "index.html" in your "public_html" directory. When you have a site with many pages, it is common to create directories within your public_html directory to better organize the information of your site. Usually each directory will also have a file named "index.html", which is the home page for those pages in that section of your site.

Note that "index.html" must be all lowercase.

File name extensions for Web pages

Web pages should always be named with the following extensions:

File name extensions for images

Image files should always be named with the following extensions:

File name extensions for cascading style sheets (CSS)

External style sheets should always be named with the following extension: