The set of redirects is not static. We will be adding and removing redirects more than a dozen times per day.

We happen to be using a CMS (DotNetNuke) that has some redirection capability built-in, but various caches must be rebuilt every time a redirect is added or removed, which causes some painful performance problems when adding or removing redirects.

I've looked at IIS Redirection. However, these redirects are stored in the web.config for the site. It feels wrong to be modifying the web.config up to a dozen times every day during live site operation with redirects. It also feels wrong to have so many redirects in a single web.config.

I suspect there may be an alternate storage method for IIS redirects, or perhaps there is another method that I don't know about.

For those that are interested in perhaps convincing me that we don't need so many redirects, I hope you are right. Here's some details:

We have 30,000 old product pages, each with its own URL.

We have 30,000 new product URL's.

We have 1 new product page with a query string parameter. Products.aspx?ProdId=123456

The redirection process will look something like this:

 OldProductURL1.PHP --301--> Products.aspx?ProdID=1 --200--> NewProductURL1.aspx


 OldPRoductURL1.PHP --301--> NewProductURL1.aspx  

(as long as the server runs Products.aspx?ProdID=1 to serve up this page)

Is there a good method for accomplishing this that will allow us to add and remove redirects without affecting live site performance significantly?


Have you considered a custom 404 error handler in IIS to do the translation after the page isn't found? You could then do DB lookups or whatever is needed to do the translation.

  • Can you think of a variant of this that provides a 301 response instead of a 404? I like the idea of the custom handler, but it's important that search engines are provided with a 301 for SEO reasons. – Brian Webster Dec 17 '10 at 22:35
  • 2
    Set your Response.Status to 301 or whatever you like in your handler. stackoverflow may a better place to ask about how to write a handler to do what WaldenL describes. stackoverflow.com/questions/2265870/301-redirect-in-asp-net – Zoredache Dec 17 '10 at 22:48
  • Zoredache is right. The handler is server-side before IIS returns the 404 to the client. In your 404 you are free to do whatever you want. Return a "friendly" not found page with a 200. Return a temp w/a 302, or a perm with a 301. Up you to (well, your programmer. :-) – WaldenL Dec 17 '10 at 22:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.