Using 301 Redirect URL Rewrite module to Redirect SharePoint urls

Many know of SharePoint Saturday and its legacy, many also know the platform we’ve been on for years has run its course of usability and collectively as a community we’ve started to migrate from the old domain over to

With the migration we need to keep the “engine juice” all the rankings from the search engines over the years that have pointed to almost a hundred different SharePoint Saturday sites.  I wanted to make sure we can redirect each and every SharePoint sub site (for example /Baltimore) over to the new domain so no one skips a beat if they go to the old domain. And again most importantly all the rankings stay the same on the new domain.

That said, I needed to figure out how this all worked. I started looking into 301 redirects and how to do that. A 301 redirect is a “permanent” redirect that tells search engines that essentially what was here has “officially” moved and the move is sanctioned as well as “here is the new location”.

I also looked into software packages that could be donated to do the same thing. Ultimately some collaboration with many folks lead me down the path to use the URL Rewrite module for iis 7 (x64 link). It started with an article from NBSP and an email from Mark Miller, a conversation and brain storming session with @ToddKlindt and finally a conversation with @Ruslan Yakushev who authored the URL Rewrite article on to understand the url patterns to use (which ended up being fairly straight forward).

So using the URL Rewrite module mentioned above there are two ways to do what I needed to do. The first way is to have a single rule but multiple mappings. Or the method I ultimately chose to use (the more extensive method) a single rule for each sub site I wanted to redirect.  So why use one or the other. Because I’m only redirecting top level sites and I know what the url will always be. And my rule (which you can see below) is that anytime someone hits redirect them to on the new domain.  However what if I wanted to redirect a list, or a library or something that has an extension that changes (i.e. default.apsx?somethinghere=16) etc. Using some elaborate mappings will allow you to cover those scenarios.

Ultimately for me, it would have taken more time to come up with all those mappings to do something pretty simple at a top level.  So here’s the break down.
1) Go install the URL Rewrite module on the server
2) Enter the drop down for Requested URL (Matches the pattern)
3) Using: Regular expressions
4) Pattern: “  ^Baltimore “ (no quotes, and Baltimore is the subsite you want to move)
5) Ignore Case: Checked (this means if I type BALTIMORE or Baltimore or baltimore it still works)
6) leave conditions and server variables empty (unless you want to venture there)
7) Action type: Redirect (you can also do rewrite to do some cool “friendly urls” with SharePoint)
8) Redirect URL:{R:0} (curly bracket capital R colon zero curly bracket)
9) Redirect Type: Permanent (301)

Once you apply the rule, it’s active. No IISRESET or reboot needed. It will be active right away. Hope that helps!

FYI: if you go hitting the and dont notice the redirect. They’re there, just not active. Yet.


3 thoughts on “Using 301 Redirect URL Rewrite module to Redirect SharePoint urls

Leave a Reply

Your email address will not be published.

No seriously, are you human? *