Posts Tagged ‘Search Engine Optimization’

Search Engine Friendly URL’s and Drupal – Part 2

Colin Calnan | Wednesday, December 3rd, 2008

In my previous post I showed you how to set the friendly URL for each page/piece of content on your site. Hand curating can be fun, but it’s also time consuming and requires a little thought. It can also be a little cumbersome when you have a long title, like the title of this post. In steps the Path Auto module to save the day. In conjunction with the Token module, Path Auto automates the task of creating and setting these URL’s. How does it work? It’s pretty simple really.

  • Using Drupals internal URL alias functionality, Path Auto automatically(automagically) creates URLs for you when you create a new piece of content.
  • The structure of this URL is determined by you, the user, via the Path Auto administration page (http://www.yoursite.com/admin/settings/pathauto).
  • Each individual content type (via CCK module) can have it’s own settings
  • The path can be hard coded to anything you like, or it can use “tokens” to determine how the page is made up, for instance:
    • The path can be made up of the title of the content (http://www.example.com/the-title-of-the-content)
    • The path can be made up of CCK types and CCK fields (http://www.example.com/albums/rock)
    • The path can be made up of vocabularies and taxonomy terms (http://www.example.com/2008/10)
    • The name of the author (http://www.example.com/colin/drupal-search-friendly-url)
    • There is a comprehensive list of the options (replacement patterns) available for creating URLs /aliases on the path auto settings page, some examples:
      • [nid] – Node Id
      • [title-raw] – Unfiltered node title
      • [yyyy]- Node creation year (four digit)
      • [term] – Name of top taxonomy term
      • [author-name] – Node author’s user name
  • Once your paths have been setup you can then select the “Bulk generate aliases for nodes that are not aliased” for those paths you have configured. This will create new URLs/aliases for your existing content. Also note that this will generate aliases for all existing nodes which do not already have aliases.
  • In the future, when creating new pieces of content, the URL/alias will be created for you based on the criteria you have chosen in the path auto settings.

So that’s it, not that difficult really. There are a few issues I’m come across when using path auto, and my one piece of advice is to decide on your alias structure before you start entering content. Or, if you have entered content and are running a bulk update, Think carefully about your alias structure. If you do mess it up there’s an easy way to re-run the alias update. You can do this via Update area of the “Content” management page. Select the content you want to update and choose “Update path alias” from the drop down options.

Search Engine Friendly URL’s and Drupal – Part 1

Colin Calnan | Thursday, August 28th, 2008

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“.

 


t. 604.684.2498 | f. 604.721.4007 | e. turningheads [at] raisedeyebrow.com