Will "the Mighty" Strohl

Simple Redirect Module for DotNetNuke Released

Simple Redirect Module for DotNetNuke

Search engine optimization (SEO) has been on the top of most minds in the website design and development for many years now, so I won’t bore you with details about what it is and why it’s important.  At this point, that should be obvious.  However, maintaining your SEO is a never-ending challenge.  This is never more apparent than when you switch platforms on the web, no matter how big or small that platform may be.  I have recently run into such a challenge.

In case you haven’t noticed, I have switched blog modules.  This post not only introduces my newest open source module, but it also clearly outlines the use case for why I built it, and why it might be of use to you as well.  While my use case involves blog modules, this could very well relate to other types of modules like announcements, forums, and any other module that creates dynamic pages based upon content you are creating.

As of Sunday, March 25, I am now using Live Blog by Mandeeps instead of the “core” blog module.  Don’t get me wrong, the core blog module is great.  I’ve used it for many years now.  It definitely fits the needs of most bloggers and blogging websites, but I really needed more, and Live Blog offers it to me right now.  Also, the difficulties I outline are not to pick on Live Blog or Mandeeps.  Both are truly great!  What I speak about here would most likely be experienced with any software, platform, or module when making a switch that affects URLs.

URLs Changing

Anyhow, this switch of modules was really the motivating factor behind building the Simple Redirect Module for DotNetNuke.  When migrating from one module to the next, the URL structure has changed.  The change was minimal on the surface, but it certainly has the potential to have a pretty significant impact on SEO one way or the other.  It really depends on how the URLs are handled now. 

This is an example of a core blog module URL for a blog post, assuming the blog module is on a page named “Blog”: 

  • http://domain.com/Blog/EntryId/123/This-is-Your-Blog-Title-in-the-URL.aspx

The Live Blog URL is very similar, and with very few differences in creating the page name – and sometimes no differences at all:

  • http://domain.com/Blog/PostId/123/This-is-Your-Blog-Title-in-the-URL.aspx

On a site like mine, you can also pretend the page extension isn’t there as well, since I am using URL Master.

Luckily, Live Blog does an incredibly great job of importing blog posts and comments from many places, including the “core” blog module.  That feature is a life-saver!

Once again, on the surface such a transition appears to be simple.  After all, the blog posts are imported, so the URLs should match up pretty nicely.  However, on an installation of DNN where there have been multiple blogs on multiple sites and multiple test posts from applications like Windows Live Writer, there are some subtle differences.

First, some posts would not have the same “page name.”  Let’s take a title like “Simple Redirect Module 01.01.01 Released.”  The resulting page names would be slightly different for each blog module, shown below.  Also shown is an example of the blog entry ID’s being slightly off since the new entries in the database no longer have the history of having had previous blog entries that are now deleted.  Both issues are bolded to make it easier to see.

  • Core Blog:  http://domain.com/Blog/EntryId/123/Simple-Redirect-Module-for-DotNetNuke-01-01-01-Released.aspx
  • Live Blog:  http://domain.com/Blog/PostId/118/Simple-Redirect-Module-for-DotNetNuke-010101-Released.aspx

And worse… Sometimes (and this will likely be fixed by the time you use the module), you might have a URL that is truncated like seen here:

  • http://domain.com/Blog/PostId/118/Simple-Redirect-Module-for-DotNetNuke-010101-Rele.aspx

As you can see, it is not very straightforward to perform any specific rewrite rules in this scenario.  At least, not easily and not without having some more information to more easily map blog entries between the two modules.

The Solution

I tried several things before finally resorting to writing a module.  I tried to find a rewrite method in URL Master, but nothing existed without writing a provider for URL Master.  I also tried using rewrite rules in SiteUrls.config, but not being able to predict the URL pattern changes consistently meant that there would need to be a direct 1-to-1 relationship in the configuration – and such a thing would adversely impact performance on every page load on the entire site and installation of DotNetNuke.

Finally, I warmed up to the idea of building a module for this.  Enter the Simple Redirect Module for DNN. 

This module allows you to simply enter a URL that no longer exists, and map that to a URL that does exist.  Easy stuff!  In the background, the module is not only pointing visitors to the right place, but it is also performing something known as a HTTP 301 Redirect, which also notifies search engines that the new page is the right one.  This instruction results in the search engine wiping out the original URL and replacing it with the new one.

This blog actually comes to you after 3 releases of the module.  While the first version worked fine, I found some performance issues when a certain number of redirects were loaded into the module.  That was release 2.  A significant amount of caching was added to address the performance issues.  Unfortunately, I had made a mistake in the packaging of the second release, so today’s release is the recommended download.

How Did I Map The URLs?

With over 700 blog posts, it wasn’t realistic to add a redirect record for every single blog post that I have.  Instead, I used Google Webmaster Tools to identify the most popular pages on my site that were impacted by the blog module change.  I mapped a redirect entry for every page that had 10 or more direct inbound links to it from another website.  Yes, that was quite a few pages.  I could have set a different benchmark to use, but that one seemed good to me.  For the rest, I am able to submit an XML Site Map to Google Webmaster Tools for indexing.  An XML Site Map is automatically generated for you by Live Blog.

In total, I’ve spent 4-5 hours working on the module, and another ~2 hours mapping URLs.  Of course planning, testing, and implementing the blog module itself took time too.  At the end of the day, that was all time well spent to retain traffic on my site, and put my best foot forward to minimize the impact to visitors that are visiting my site.

I invite you to play with the module.  There are many different types of redirect modules out there.  This one was meant to handle a very specific use case, hence the name.  I hope you like it!

Download the Simple Redirect Module

blog comments powered by Disqus