Permanent Redirects with HTTP 301
The very latest version of DasBlog uses a 301 Permanent Redirect to send aggregators to my feed's new location at FeedBurner. Because it's a 301, most aggregators automatically update their data with a new location and don't bother asking for the original one again.
Here's how to do a hardcoded 301 redirect within ASP.NET:
response.StatusCode = 301;
response.Status = "301 Moved Permanently";
response.RedirectLocation = "http://www.hanselman.com/blog";
You can also do this, which I see a lot while looking at the bathroom wall of code folks call Google Groups:
They pretty much do the same thing, but color me reactionary, I like to use the APIs available just for cleanliness's sake.
Of course this is a redirect, not an URL rewrite. Redirect's go all the way back to the requester and provide a hint on where to go next, while rewrites leave the requested the URL the same and tell the web server that something else was requested.
DasBlog has a lovely rewriting HttpModule that you're welcome to use. Erv Walter extended it and added support for redirecting URLs as well as fixing host names. These things are particularly useful if you do not have direct access to your web server's administrative console.
Fritz Onion, my hero but a man I've never met, also has a great redirecting module that's very elegant and coincidentally uses Craig Andera's "Only Configuration Section Handler You'll Ever Need" which is a fantastically snazzy chunk of code that I just can't seem to get folks here at work to latch onto.
Whichever one of these models you use, or if you write the redirect yourself, remember the "principle of least surprise."
If I type in the URL, I don't care how you get me there, just get me there.
UPDATE: It was asked in email "Whats a [good] way around postback URLs getting f'ed up when rewriting URLs." To answer that, I point you to an oldy, but a goody, a blog post with a clever title that no one really every appreciated, IMHO: "Postbacks for Algernon"