Search Engine Friendly URL's and Drupal - Part 1

Content management systems (CMS) allow you to create content on the fly without having to worry about coding in HTML or uploading via FTP. Most content management systems then use a combination of PHP or ASP querystrings to deliver that content in a format something like http://www.yourdomain.tld?pid=36 or http://www.yourdomain.tld?q=node/15.

The reason for this is mostly to do with the database driven nature of a CMS, and it's ability to retrieve all content/data related to a specific id. So what’s wrong with that? Most search engines don't index pages whose URL contains a question mark or other character (like an ampersand '&' or equals sign '=').

What does this mean? It means that people can't find your site. There are times however when you will want to create a nice clean URL for use in a marketing campaign or as a link on Facebook, or some other link sharing website. There are a number of ways to achieve this using Drupal and I'll examine each of them in turn. Today we're going to hand curate (Emiras favourite term) them.

Hand Curated

The quickest and easiest way to create a nice URL is to do it when you're creating new content. Scroll down to the "URL Path Settings" area and simply enter your path. Remember to leave out the trailing slash at the end, otherwise it won't work, it'll be banjaxed.

While this path can be anything you want, try to keep to the following rules:

  1. Keep it short - no one will remember a really long URL.
  2. Keep it simple - we're not trying to win the Man Booker Prize here.
  3. Keep it relevant - the URL should relate to the title of the page/article and it's content - search engines take relevancy into account too when indexing your pages.
  4. Keep it organized - if you have a few different types of content on your site, try to organize your content via the URL. For example all Articles would go under "articles/your-title-here" and all Publications would go under "publications/your-title-here". Also note that I use the hyphen "-" to separate the words in the title. You can use the underscore also "_", but I prefer the hyphen as it's easier to read aloud and people refer to it as "dash" also. You'd be surprised how many people I speak to don't know what "underscore" or "underbar" means.

In Part 2 I'll examine using the Path Auto module to automate this for you and then for Part 3 I'll go on to talk about using Views and Arguments and how they can be used to create what are called "Hackable URL's".