Naming Conventions

The names of pages (and other files) and sections (folders) in Modern Campus CMS are used in the URL for that content. For this reason, when naming pages and sections on your site, you'll want to consider:

  • the readability of the full URL for humans and search engines
  • the organization of the site's content and its impact on the URL structure

This page is intended to provide some guidelines for naming pages and sections which should help with those considerations. We'll start with an overview of the recommended conventions, then we'll go into detail on which conventions are systematically enforced, why these conventions are in place, etc.

Throughout this page, the words file(s) and page(s) will be used interchangeably, as will the words section(s) and folder(s). A page is a specific type of file and a section is a specific type of folder (intended to contain pages), but for naming purposes the distinctions are usually not important. When the distinction is important, it will be called out in the text.

Overview

When naming files and folders, only lowercase letters (a - z), numbers (0 - 9), hyphens (-), underscores (_), and periods (.) are permitted.

  • Hyphens (-) should be used as word separators.
  • Periods (.) should only be used as part of a file extension (e.g. "file-name.pdf").
  • Underscores (_) should be used for one of two purposes:
    • at the beginning of a file/folder name when the file/folder should be at the top of the file listing in the CMS to improve visibility for users and the file/folder name is not intended to be part of a page URL (e.g. a shared "_images" or "_files" folder, this is more important for pages than for files, as file URLs are not usually as visible to users) or
    • in file names when using hyphens as word separators might be confusing (e.g. when a person's name is hyphenated and used in the file name).

Keep names simple and to the point.

  • Identify the content
  • Exclude filler words
  • Consolidate similarly-named files into a folder
  • Don't repeat words used earlier in the URL
  • Don't use the same name for both a page and section

Words used earlier in the URL include all of the file's parent folders as well as the website's domain and subdomain names. For example, the Fowler College of Business' subdomain name is business.sdsu.edu, so neither "business" nor "sdsu" should be used in the name of a folder or file on their site. Some necessary exceptions may occur (e.g. programs in Business Administration), but should be limited.

Names in Context

Acronyms

  • Don't use acronyms in URLs unless they are well-known to your target audience.
  • Don't assume that prospective students are familiar with an acronym that is commonly used within an academic (or even professional) field.
  • Don't modify acronyms in URLs (e.g. adding an "s" to make them plural, as done multiple times on this page with URLs), since mixed case isn't available to clarify which letters are part of the acronym.

If the acronym can't be avoided in the URL due to length, make sure the text (especially in links) makes the association clear so search engines will be more likely to present the content to users.

Words that don't provide additional context

Try to avoid using words that don't provide additional context in file/folder names. If they naturally make their way into the content/structure of the site, take a moment to consider whether the content can be restructured to place the content elsewhere, or whether the word(s) can be removed from the file/folder names.

Information

One common example is "information for" with various target audiences. It may be helpful to create a section named "information-for" and group all of the pages targeting specific audiences together in terms of the internal organization of a site, but "/information-for/" is not helpful in the URL itself. Everything on the site is "information for" someone.

The biggest way the word "information" can help is in distinguishing between "information for" a particular group vs. "information about" a particular group. Just as content "about" the organization that runs the website/program/college/etc. might be grouped into an /about/ folder, it may be worth considering a /for/ folder for the pages targeting specific audiences.

Resources

This is such a prevalent term that every site has a /_resources/ folder to organize assets, templates, include files, and other resources for the website. When it comes to pages on a website, though, this is commonly a keyword for a page that contains nothing more than a list of links. This also commonly falls into the form of "resources for" a particular group. This naming convention primarily came about once it became known that this type of page was not a good idea and pages named "links" drew negative attention.

Content owners inevitably feel that certain sites are going to be useful to their visitors, especially if the rest of the content on the site is linking to a lot of pages on those sites. Users only visit the "resources" page if they are directed to it and/or did not find what they were looking for on the site but somehow still trust that the site can direct them to it. If they actually follow these links, they've reached the point of desperation and would be better served if those links were naturally integrated into the content.

Multilingual Content

The language of file/folder names should match the language of the content. If a page's content is predominently in Spanish, the name of the page should also be in Spanish.

If a large amount of content is going to be provided in another language, consider creating a section named after the language code for that content in the root of the site, creating another site using that language code in the subdomain, or using a country-specific domain. More information about multilingual content.

Details

Enforced Conventions

Modern Campus CMS will enforce the following conventions when naming files:

  • Only lowercase letters (a-z), numbers, hyphens (-), underscores (_), and periods (.) are permitted in file names.
  • No spaces are allowed.
  • No uppercase letters are allowed.

Why?

These conventions allow us to ensure some consistency in URLs and make it less likely that users will experience confusing errors.

  • Some web servers are case-sensitive, so a URL with mixed-case letters is not necessarily the same as a URL with only lowercase letters.
  • Most of the other characters on a standard U.S. keyboard are "reserved characters" in URLs and have to be percent-encoded if they are used in file/folder names.

Most users don't understand percent-encoded characters and search engines may not bother to unencode them when indexing your content. It can also be difficult to maintain a site when you try to link to "a filename with spaces, commas, & ampersands (with parens).pdf" and the link either doesn't work or comes out as "a%20filename%20with%20spaces%2C%20commas%2C%20%26%20ampersands%20%28with%20parens%29.pdf".

Related Error Messages

If you attempt to upload a file, rename a file, or create a new file using a name which does not meet these requirements, you will receive an error. In most cases, the error message should include "Please use only lowercase letters, numbers, and hyphens (-)." If you try to upload a file which is not named properly, you may receive an incorrect message stating that the file is too large. Other potential error messages may inform you that the file/folder name contains invalid characters.

Error messages about an uploaded file being too large are usually due to a problem with the filename. The actual upload size limits are very generous, but the system has to recognize the file's extension (usually a period followed by a 3 or 4 character code at the end of the filename) to apply the size limits correctly. If the filename follows the naming conventions, verify that the extension is correct (one of the most common errors is that a PDF file is named some-file.pdf.txt).

Unenforced Conventions

Modern Campus CMS is very permissive by design and many naming conventions would be difficult to enforce programatically. It is up to us to determine what is best for our content, but the following should provide some basic guidelines and a little context for why these guidelines are important.

Keep names simple and to the point.

  • Identify the content
  • Exclude filler words (if you wouldn't capitalize the word in a title, you usually don't need it in the URL)
  • Consider consolidating similarly-named files into a folder
  • Don't repeat words or use the same name for both a page and section

This page could have been named "naming-conventions-for-websites". Eliminating the filler word would leave "naming-conventions-websites", which could be made easier to understand by moving things around: "website-naming-conventions". Does "website" help the user understand the purpose of this page? Is "website" really accurate in this case? It would be more accurate to use "website-file-and-folder-naming-conventions", but maybe some of that can be implied by context (since the page is on a support site for a web content management system).

Use the shortest, simplest name possible to convey the purpose to the user.

Structure

Keep the structure of the site as simple as possible. If a site has grown over time, its structure may need to be reconsidered.

Break Up Long Pages

A long page may need to be broken up into smaller pages. One way to accomplish this is to:

  1. Create a section that uses the same name as the page
  2. Delete the index page that was automatically created in the new section
  3. Move the page into the new section
  4. Rename the page to "index"
  5. Create new pages within the section and move content from the original page into it
  6. Use the index page to summarize and help the user navigate the section's content

As long as the server configuration hides file extensions on pages, the trailing slash on folders, and the filename for index pages, this method does not require redirects to be configured from the original page to the index page in the new section.

Create Sections to Group Similarly Named Pages

Over time, several pages may have been created with similar names to discuss portions of a common subject. If I have the following pages:

  • feed-components
  • info-box-component
  • quote-panel-components
  • components-timeline

Users might be better served if I:

  1. Create a components section
  2. Move all of the related pages into the new section
  3. Rename all of the files to remove "component"
  4. Add some introductory text and navigation aids to the components section's index page
  5. Configure redirects so users with bookmarks or following old links will still find the content and search engines will transfer the pages' search ranking

Word Separators

Most users and search engines will identify one of two values as a word separator in your URL:

  • a slash (/) which is automatically placed between folder/file names
  • a hyphen (-) which you can place in your folder/file names for this purpose

Some people like to use underscores (_) for this purpose, but search engines are less likely to recognize them. Others like to use periods (.), but search engines are likely to expect anything following a period in a filename to be a file extension.

Don't assume that users and search engines will be able to readily identify the intended words in your folder/file names without word separators. At best, it takes them a little longer to work out the intended meaning. At worst, they find words you didn't intend.

Dates

If you use dates in your folder/file names, use the form YYYY-MM-DD or YYYY/MM/DD, using the full 4-digit year and 2-digit month/day. The hyphenated format is part of the ISO 8601 standard for the communication of date and time-related data and works well for organizing files in a computer system, since it works with normal file sorting rules.