Migrating to Orchard, handing new URL structure while preserving existing search rankings (ie: 302's)

Topics: General, Installing Orchard
Jan 6, 2013 at 11:54 AM

Love this engine after comparing a bunch of different options. I'm migrating from SubText (http://www.andrewconnell.com/blog). I figure I'll import my content using the BlogML module (but likely to use something like Disqus for commenting and need to figure out how to import my comments using Disqus). My question is about handling my old URL format & preserve search rankings.

Today my blog engine lives under the /blog folder (which runs as an ASP.NET application). When I deploy Orchard I plan to deploy it to the root (using Azure Hosted Services, not Azure Websites). My current engine uses a specific URL formatting, for instance all content is under /blog/archive/YYYY/MM/DD/[posttitle].aspx, rollups for specific categories are /blog/category/##.aspx, rollups for a month are /blog/archive/YYYY/MM.aspx.

What I'd like to do is create some sort of a global handler where URLs not caught by Orchard are handed off to my HttpModule/Handler. It will see if the URL matches an old SubText format and if so, use a local table that I populated with old & new URLs to redirect them with a HTTP 302 & record the HTTP referrer when it occurred.

Because I plan to use Azure for deployment, I can't just easily create a new /blog folder as a new ASP.NET application and stick a global HTTP handler for all requests come in. Ideally if I could just put an edit into the Orchard web.config that routes everything with [domain]/blog in the URL to my custom module. The goal is to make the absolute minimal changes to the Orchard core source as I don't want to maintain my own fork if at all possible (I don't mind obtaining modules & themes locally, packaging and deploying to Azure each time I want to change stuff).

So how would one suggest you go about this when deploying Orchard?

Jan 10, 2013 at 8:24 AM
Edited Jan 10, 2013 at 8:25 AM

you could just add the old url's as aliases (checkout the aliasui module that comes prepackaged with orchard), then modify the alias implementation to do a 302 when it finds aliases. (we did something similar)

Jan 19, 2013 at 10:47 AM

Does that module use HTTP 302's to the new URLs? The idea is I want to CHANGE the URLs to a new format from what I currently have been using. Ideally I don't want to have to enter each old URL into the module as I'm looking at roughly 2000+ URLs. I'd rather build a HTTP Handler that handles all 404's, tries to find a map to a new URL based on a pattern and if it finds it, it sends a 302. If it doesn't find it, worst case it does a 404.

Jan 19, 2013 at 10:50 PM

You can use either IIS URL rewrites, or the Rewrite Rules module (http://gallery.orchardproject.net/List/Modules/Orchard.Module.Contrib.RewriteRules) to do permanent redirects.

Jan 20, 2013 at 10:33 AM

Tremendous... Rewrite Rules module might be exactly what I'm looking for.