301 redir pattern using IIS 8

Posted on 2014-08-15
Last Modified: 2014-09-09
I'm replacing an old website, but want to preserve the Google ranking of the old product pages as much as possible, so need to implement 301 permanent redirects for a few hundred product pages.

Open in new window

The new site is running on IIS 8

The URLs generally follow a pattern. I'm not up to speed on the new rewrite features of IIS 7/8. I believe that there is a way to either implement a pattern using wildcards OR regular expressions.

Can somebody please point me to the best way to do this using IIS 8?

Here's an example of the product pages that need to be rewritten:
OriginalDomain/Widget-Category/Undercover__UNDERCOVER.aspx		NewDomain/gadget-category/undercover
OriginalDomain/Widget-Category/Arrow__ARROW.aspx			NewDomain/gadget-category/arrow
OriginalDomain/Widget-Category/Dodger__DODGER.aspx			NewDomain/gadget-category/dodger
OriginalDomain/Widget-Category/Small-Kona-SET__SMALLKONASET.aspx	NewDomain/gadget-category/small-kona-set
OriginalDomain/Widget-Category/Kona__KONA.aspx				NewDomain/gadget-category/kona

Open in new window

Question by:cdakz

    Author Comment

    Forgot to add this this site is running on a remote, shared server, so I don't have access to the IIS MMC Console, which I see can be used to generate rules on-the-fly.

    I guess what I'm saying is that I'm looking for a way to do this in a .config file.
    LVL 34

    Accepted Solution

    I noticed this question because I have an alert set up for regular expression related questions... I'm not familiar with IIS, but copying the technique of an example I found elsewhere, I added a suitable pattern and action, so it might work for you:
        <rule name="Redirect VIN">
                        <match url="OriginalDomain/Widget-Category/([^_]*)" />
                        <action type="Rewrite" url="NewDomain/gadget-category/{R:1}" />

    Open in new window

    In your example the words Undercover, Arrow etc in the original URI have the first letter as upper case. I'm not sure how you might convert that to lower case for the new URI, but perhaps it doesn't matter?

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Suggested Solutions

    Lync server 2013 Backup Service Error ID 4049 – After File Share Migration
    Wondering how you can get your new website ranking on Google Search so that people find you online?  The answer is Search Engine Optimization (SEO). So how do you Start Ranking a New site with SEO?  Below is a starter guide to get your new website S…
    This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
    This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now