• Publisert
  • 1 min

Epinova.PermanentLinkKeeper released

Whenever you move a page or rename it's UrlSegment property, external links to your page break. This is not a good thing, neither for your users, nor for search engines that find those links. There is now an easy to use solution to this.

For instance when using the built in archiving or our own DateTreeArchive. Or when you're simply tidying or restructuring your content tree, this will occur. This was a problem for one of our customers - they shared news on their Facebook page, and about a month later, the link was broken because the archiving had done its job.

The solution: Automated redirects

Retrospectively, the solution seems obvious - and should also be a default feature in every CMS. Epinova.PermanentLinkKeeper - when set up correctly (not a lot) - will handle the problem of moved or renamed pages. Whenever you move or rename a page's UrlSegment, this simple module gets the external URL for the page, and stores it along with it's page ID and language branch. Upon requests to this old, now empty URL, a simple HttpModule looks up the URL in its database and if found, redirects you to the correct page.

The module has been tested in production environments, and easily handle hundreds - if not thousands, of records in the database without any mentionable performance hit. It's not like every single user is going to hit a broken link anyways.

Get started

To get started, simply get the module from epicode and build it yourself, or download the nuget package from the episerver nuget feed. The module takes care of the rest for you.

And if you're not using NuGet, you also have to add the following line to the httpModules section of your web.config:

<add name="RedirectModule" type="Epinova.PermanentLinkKeeper.RedirectModule, Epinova.PermanentLinkKeeper"/> 

Also, creds to our own Jørgen HelgheimØyvind Tanum and Thomas Leela and  for some essential fixes along the way.