Technology, Smartphones, Games


Search Engine Optimization - Redirecting Old URLs to New URLs permanently with Http Status Code 301 - BlogEngine.Net

seo-blocks

If you are using BlogEngine.Net

When you change the Slug of a Page or Post your URL will change and all the previous Backlinks or Old Bookmarks will stop working and will show a 404 Error.  To Solve this issue, you can use a BlogEngine.Net extension written by SpiceLogic.

Using this extension you can add your old URL and New  url, so that old URL will redirect to new URL with 301 Http Status Code.

The code available on the authors website shows error when I tried it, because the code available to download is missing an assembly reference.

So either you can download the code from the author website here and add

using BlogEngine.Core.Web.Extensions;

or you can download the edited extension here SeoRedirection.cs (2.12 kb) (Tested only on latest stable version of BlogEngine.Net) (All credit goes to Original Author, we just added one line of code to make it work)

rest same on the author’s post

1. Copy the code to Extensions folder (App_Code/Extensions)

2. Edit Web.Config and add below line under <httpModules>

<add name="SeoRedirector" type="SeoRedirector, App_Code"/>

image

3. Go to Extension on admin section

image

4. Add Old and new url pairs

image