301 redir pattern using IIS 8

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

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

cdakzAuthor Commented:
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.
Terry WoodsIT GuruCommented:
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?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft IIS Web Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.