Web Guidelines - Naming Files, Subdirectories, and Links
The way you name Web files, subdirectories, and links makes it easier for users to find information and navigate your site. A logical naming system also makes it easier for you to maintain your site.
Organize files into subdirectories
If you are a Windows user, it may help to think of a subdirectory as being similar to a folder. You can organize your HTML files by topic in subdirectories. You might create several different subdirectories, such as a forms subdirectory, or a graphics subdirectory.
Use index.html, index.shtml, or index.php as the name for the first, or primary page of your Web site
If the primary page is called index.html, index.shtml, or index.php you do not need to specify it when listing URLs. Both of the links below work, but the shorter one follows standard naming conventions and is easier to remember and type:
- Acceptable: http://www.utexas.edu/news/index.php
- Better: http://www.utexas.edu/news/
When linking from other sites or pages to your main page, don't specify /news/index.html in the link. You can just point to /news/. This is helpful if you decide to change the file extension of your main page from index.html to something else later on, such as index.php. If other pages link to /news/index.html they will need to be changed. If those same pages linked to /news/, the links will work no matter what type of file extension you use.
Use a consistent URL for periodical newsletters or publications
Let's say you publish a monthly newsletter for example. When you publish the January newsletter you might be tempted to name it january.html. That works fine for this month, but what happens next month when the latest or current version is no longer called january.html. Consider creating a directory called current or a file called current.html for the latest version of your newsletter or other similarly recurring publication.
Keep file and subdirectory names short and descriptive
Give your files and subdirectories short, descriptive names and always use lower case only. Remember, these names appear in your URL, which is case sensitive. For example:
- This works: http://www.utexas.edu/learn/
- This doesn't work: http://www.utexas.edu/Learn/ - (L in Learn should be lower case)
Keeping file names short and in lower case simplifies your URL. When you have to communicate a URL verbally to someone, they are more likely remember if it is:
- Good: http://www.utexas.edu/path/to/your/page/
- Bad: http://www.utexas.edu/Path/to/YOUR/PaGe/
Make link text meaningful
Repeat usage of click here does not help readers easily locate the information they need. Instead, write your link text to describe the page it links to.
- Bad: To learn to publish, click here.
- Good: To learn to publish, see Learning to Publish. (Avoid this redundancy)
- Better: To publish in Web Central, see Learning to
Publish.
- Bad: For information on HTML, click here
- Good: For information on HTML, see Learning HTML
- Better: See Learning HTML for more information.
