Skip to main content

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.


Popular posts from this blog

Thoughts, shortcomings, gotchas on SPFx Dynamic Data capabilities

It's the festive break, and I thought I'd try the new Dynamic Data capabilities that recently went to General Availability in SharePoint Framework 1.7.

I've been building a lot of React components lately, and all the SPFx web parts and application customisers with visual elements we create at Engage Squared, are built on React.  Dynamic Data in SPFx introduces a whole new world of modularity that we haven't had before. We can now split up the page elements into multiple web parts that, in the past, have been combined as one web part so state can be passed between them.  Doing this gives control back to the page author, with the ability to position components how they wish.

Breaking components up in to individual web parts also changes the way the components are designed, and forces the developer to leverage the responsive capabilities of modern pages.  Modern pages are designed from the ground up to work on many different screen sizes, and as long as each individual co…

Apps for SharePoint 2013 - Client and Server-side code

It's about time I blew the dust off this blog. Tonight I did a presentation at the Melbourne SharePoint User Group entitled Apps For SharePoint (2013). It included two demos based on the App For SharePoint 2013 solution template in Visual Studio 2012.

The two demos illustrated how you can create a separate ASP.Net Web Application. Demo 1 showed how easy it is to hook in to SharePoint to obtain List properties via server-side code (populating an ASP.Net Repeater Control). Demo 2 showed what you can do with SharePoint 2013's Javascript hooks. Specifically, using SP.UI.Controls.js from the /_layouts/15/ SharePoint folder to pull chrome elements out of SharePoint, and render them in your ASP.Net web app.

No animals were harmed in the making of these demos, but a few articles kindly provided on the Microsoft MSDN site helped put it together:
How to: Set up an on-premises development environment for apps for SharePointHow to: Create high-trust apps for SharePoint 2013 using the se…

SharePoint "Like" button

Ever wondered what the users of your Intranet really like or don't like? Ever wanted your SharePoint 2007 site to be more "web 2.0"-ey? Well I've published this quick and dirty codeplex project that allows the addition of a "Like" button the any SharePoint List item page.
The project is available as a WSP, and source code.
It consists of two things - a Web Part that is the button that users click to "Like" or "Unlike" something, and a List Template that can be used to create a list to store who "Likes" an item.
The button has two ways of operating. If it finds a list that was built on the List Template included in the WSP, it allows each user to Like or Unlike an item as they see fit. The button uses the List it found to keep track of who likes a given item, and queries the list when it renders to determine which option should be presented. Along with the button, the web part also displays a brief message explaining how many pe…