So, sometime last year, RDA engaged in a project with a client to migrate a SharePoint 2003 environment to SharePoint 2007. After some initial planning, we determined that a one-time content database migration was going to be the best approach. However, we had a few complications to consider:
- When using this upgrade path, SharePoint 2007 takes some liberties with the URL structure of the sites once the databases are attached to the 2007 environment and upgraded. For example, the familiar “C” addresses of 2003 (Ex: http:\sharepoint2003C10HR) were converted to “Topics” (Ex: http:\sharepoint2003TopicsHR).
- The client was not incredibly happy with their existing site taxonomy in general and wanted to take the opportunity to rearrange their sites as part of the upgrade.
The problem: The project would be considered a failure by the user community if everyone lost their IE favorites and links already embedded in content. We needed a solution to redirect URL requests from the old URL schema to the new locations.
Todd Klindt has an excellent article on different options for implementing redirection in SharePoint. Check it out here: http://www.toddklindt.com/blog/Lists/Posts/Post.aspx?ID=48
Upon reviewing the various options, I decided that none of the techniques would really work for the size and scope of what was needed. We needed:
- A way to define redirection farm-wide – for hundreds of sites. Not just one-off rules for redirecting single pages or sites.
- A way to redirect all URLs for ALL content under a site – not just the first page of the site. If the user linked to an image 15 folders deep in a site, that link should still function even if the site is moved or renamed.
- Immediate redirection – no 5 second wait for redirection pages. Ideally, the user shouldn’t even realize they’ve been redirected.
So, I decided to build the SharePoint URL Redirector. I’ve released a binary, documentation and source code on CodePlex here:
The SharePoint URL Redirector features:
- Regular Expression based rules – Permits massive flexibility in redirecting content requests. Entire sites of content to be redirected to other locations in a single rule. Not just single pages.
- Test Driven Design – Built-in testing interface simplifies the design and upkeep of redirection rules. Immediately see conflicting rules or URLs that are no longer valid.
- Centralized Rule Management - UI for maintaining rules is integrated into SharePoint Central Administration.
- Immediate Redirection – Redirection is immediate. Users typically don’t even notice that they’ve been redirected from their original URL. No annoying “You’ll be redirected in 5 seconds” pages.
- Scalable – Creatively caches rules and translations to maintain page-load performance. Has been tested with hundreds of redirection rules utilized with no perceived difference in page load times.
- Ability to copy rules – Rules can easily be copied to other SharePoint web applications.
- Chainable - Complex redirection can be performed by chaining multiple rules.
In the end, using this solution, we successfully provided seamless redirection for all content in over 350 sites (and many many more sub-sites). Most user’s have never noticed a difference. Since then, several other RDA’ers have utilized it on their projects for other reasons such as:
- Accommodating Site Moves – If you ever have to relocate a site to a new site collection because it’s gotten too large and needs its own content databases, you can redirect the old URL scheme to the new one. No need to have to explain to users why you moved their site and broke their IE favorites.
- Fill in holes in the URL scheme of your site – For example, if all of your sites are located under http://company.com/sites/* (a wildcard managed path), then there is no page directly under http://company/sites. Redirect that URL to a site directory or home page for a better overall experience for users of your environment.
- Vanity URLs – Configured properly, you could setup a vanity URL at http://finance.company.com that redirects the user to the real site at http://depts.company.com/sites/finance. Sometime soon, I’ll post an article on exactly how to do this.
So, please check it out. I highly suggest reading the documentation posted on CodePlex with the tool, and utilizing the test-driven approach to defining rules. It’s really fun to see the green indicator light up after you successfully define and test a rule! Also, if you’re unfamiliar with Regular Expression syntax, a pretty good overview can be found here: http://www.codeproject.com/KB/dotnet/regextutorial.aspx