This article overviews file naming best practices for web pages and blogs.
Need to clean up old files? Contact Web Services at firstname.lastname@example.org for assistance deleting old files in Drupal, or in making sense of and cleaning up large numbers of blog files.
It’s best to be consistent and keep things simple when naming files for your website. You may need more complex naming conventions and multiple versions of files on your hard drive or shared drive, but simplifying file names for the web decreases the risk that your links will break or that some people will have trouble opening your files.
Don't use dates
Unless you have multiple versions of a file online!
- If I name my document List_of_Ponies2012.pdf and other offices link to that list, I break everyone else’s links when I replace the file with List_of_Ponies2013.pdf.
- If I forget to delete the 2012 file, everyone else is seeing last year’s list of ponies, and we don’t want that!
- If people must be able to refer to an older version of a file as well as the current version (example: financial aid forms), use dates, but make sure departments you work with know to check for new versions and update their links (or link to a page listing your forms)
- List_of_Ponies.pdf is usually better than List_of_Ponies2013.pdf
Browsers turn the character for a space into “%20” and that gets really messy. Use Mixed Case or underscores instead of spaces.
- http://www.brynmawr.edu/parties/Dinosaur Tea Party.pdf becomes http://www.brynmawr.edu/parties/Dinosaur%20Tea%20Party.pdf and can cause confusion or errors.
- Or if you’re pasting that address into email, the space may cause the link to break, leading to confusion and sadness as your users go to http://www.brynmawr.edu/parties/Dinosaur and get an error.
- Instead of Dinosaur Tea Party.pdf , use DinosaurTeaParty.pdf or Dinosaur_Tea_Party.pdf
Use consistent capitalization
This makes it easier to remember what you named a file, and also avoids a tricky difference between most of your computers’ operating systems and the web server’s.
- Windows and Mac OSX don’t pay attention to case in file names– they think owls.pdf and OWLS.pdf are the same. So I can’t make two separate files called owls.pdf. and OWLS.pdf .
- Linux, the operating system that runs our web server (and most other web servers) does pay attention to case in file names. So if I upload owls.pdf , and then later create some other file OWLS.pdf and upload it, they’ll both be there, causing confusion.
If you have any additional questions or problems, don't hesitate to reach out to the Help Desk!