December 27, 2016

When is a Space not a Space?

When its %20.

When we empower a client to use a content management system (CMS) to manage their website or an email marketing program to send out newsletters, it is easy to forget that not all things on the web are the same as on your computer. In the strange and shadowy world of HTML code, server languages and URL arguments you are bound to come across a few strange nuances that can spell success or failure for your web content.

Today we take a look at the “space” when naming a file. For both your own organization and for search engine optimization (SEO), it is important to relate the name of files on a website to the content of file. However, while adding spaces, ampersands or quotations can make filename titles easier to read, adding these special characters can lead to ‘404 Page not Found’ errors when used on websites. Every letter and punctuation mark has a unique code to represent them on the web.

Browsers and CMS systems often get confused when certain characters are not properly represented to them. While letters and numbers are generally not translated into their code equivalent, punctuation marks are not treated as equally. Because these marks have dual meanings on the web, your browser may interpret these as something else and replace these with their code equivalent. For example:

  • A space can be replaced with %20
  • A quotation ( “ ) can be replaced with %22
  • An ampersand ( & ) can be replaced with %26

These codes can cause confusion and sometimes have unintended results on your website if using a CMS. To avoid these, filenames should use a dash ( - ) between words rather than actual spaces. This will keep things relatively readable for you and help make sure the file is understandable by the web as well.

Aside from the punctuation, the actual name you choose is important as well. The golden rule for naming documents on the web is: “The shorter the better”. However, you do want to choose relevant the titles for the content of the file and use natural language in your filenames. This can help users understand you documents as well as ensure search engines do an accurate job of indexing pages, images and PDFs for results on keywords associated with your site.

So, the next time you are writing up your site content, newsletter, blog article or posting important documents, consider that a space is not always a space.