Sunday, February 6, 2011

SharePoint List-based 404 handler

A project that I'm involved in is about to begin, which includes a complete refresh of our Intranet site, based on SharePoint. One of the key requirements of the refresh is to look at the Information Architecture, and look at ways of making it easier to find content for the typical user.



As you may know, dealing with a major site re-architecture like this will innevitably mean links strewn around the place that refer to old content. These might be favourites on users' web browsers, links on other websites, and indeed links throughout the content of your SharePoint site. Some may be updated within the SharePoint site, but a large proportion of them remain static due to various factors such as them being defined in Content Editor Web Parts, or the like.



As it stands, the SharePoint site in question doesn't have any custom 404 page handling already, so even now when minor changes occur to the Information Architecture of the site, old links are left behind without any thought as to what the user might experience.



The up-shot of all this? I took it upon myself to create a custom 404 handler for SharePoint. Not only did I want this handler to display a customised page to the user (this part is relatively easy), but I also wanted to be able to dynamically define URLs of the missing pages to pick up on, and customise the response accordingly.



This has culminated in to my latest Open Source project loaded up on to Codeplex - SharePoint List-based 404 handler. Once deployed, and two Features are Activated, you can enjoy the use of a SharePoint List to define wildcard or regular expression based strings to match the source URL, and tell it what to do with the request - either display a custom message to the user, or redirect them to another page or site. The redirect has Regular Expression Substitutions enabled, so you can get tricky over where you want to redirect the user to.



Further documentation is available on the site, so check it out if you're interested - SharePoint List-based 404 handler.

No comments:

Post a Comment