huilaaja / RedirectManager

Simple and portable redirect manager for Episerver websites
14 stars 5 forks source link

Redirect Manager

Redirect Manager is simple, portable, extendable, open source redirect tool for Episerver projects.

Description

It's built to be as minimalistic as possible and as an example of simple Episerver add-on. It requires only 7 files for business logic and data access, 2 controllers and 1 view.

New 2.0 version has a bit smaller appearance and multi-site support

Preview:

Features

The key features actually are what this add-on is NOT

Redirection rules

Here's couple of examples what kind of rules are possible.

Minimum Requirements

Installation instructions

  1. Install Entity Framework from NuGet.
    https://www.nuget.org/packages/EntityFramework
  2. Copy files into your project
  3. Add .MapMvcAttributeRoutes() to RegisterRoutes override in Global.asax.cs
  4. Apply manually Web.Config transformations
  5. Go to www.yourproject.com/Admin/RedirectManager

Instructions for usage

File structuce

Basic 404 redirect logic

Auto wire up

You can automatically populate the RedirectManager with data on following events from editors, moving pages in structure, renaming url segment and deleting from Waste Basket. Just put this in your InitializableModule:

var events = ServiceLocator.Current.GetInstance<ContentEvents>();
            events.MovingContent += RedirectKeeper.Page_Moving;
            events.PublishingContent += RedirectKeeper.UrlSegment_Changed;
            events.DeletedContent += RedirectKeeper.Page_Deleted;