Pathauto is Path Awesome

One of the easiest things you can do to give your website a professional appearance is to use the Path module (core) to enable pretty URLs/aliases and the Pathauto module to automatically generate aliases. Sensible alias configurations give your site a nice, polished look as well as make your content search engine friendly by including node (user and taxonomy, too) data in your URLs.

Pathauto works by setting patterns which include Tokens to generate aliases based from node data. The idea is to assign and manage aliases to content as the content is created. For a general user the alias generation happens all behind the scenes while privileged users are given the option to manually assign or change aliases.

Use these guidelines and you'll have a great setup for URLs on your site. Feel free to experiment to find configurations that suit your website best.

  1. Set the default node paths. Nobody wants their Drupal site to work just like every other Drupal site out there so lose the default "content/[node:title]" alias pattern. Instead set the default node pattern to "[node:content-type:name]/[node:title]". This will give us URL aliases such as photo/yearbook-class-1998 and video/crazy-hilarious-video.
  2. Give significant content shorter aliases. If the site consists of mainly user-submited posts and events with a few pages of instructions, give those pages shorter aliases. I like to give "page" nodes an alias of just "[node:title]".
  3. Utilize date information. Some content types have dates as a natural part of the data type. For a blog post, maybe throw in the year and month of the post date "blog/[node:created:custom:Y]/[node:created:custom:m]/[node:created:custom:d]/[node:title]" or for an event use year, month, and day of the event's start date "event/[node:field-date:value:custom:Y]/[node:field-date:value:custom:m]/[node:field-date:value:custom:d]". Not all dates are created equal, so don't use dates where it doesn't make sense.
  4. Avoid alias collisions. If you end up with multiple pieces of content that produse the same alias, an increasing numeric value is added to the end of the duplicate aliases. This is ugly but unfortnately Drupal can't read your mind to assign the alias. If you anticipate large amount of content and/or the possibily of similar content, add in another token such as [node:nid] or [node:author:name] to increase the chance of a unique alias. Dates also work great for this.
  5. Use the default settings, almost. Besides patterns, Pathauto also has numerous options for handling punctuation, word separators, etc. I recommend using the default settings for this except for the update action. Each piece of content should have exactly one alias and it should remain unchanged except in special circumstances. Set your update action to "Do nothing. Leave the old alias intact". This will prevent breaking incoming links and bookmark and will also help you keep existing SEO juju.