Yes, URL-rewriting is a great technique. Last week I had to update one of our web applications, and I actually needed URL-rewriting to remain backward compatible. Our previous version had an ASPX-page (document.aspx) to handle document downloads, which was sub-optimal. In the new version, I created an ASHX-handler (document.ashx) that is very lightweight and does the same. But the document.aspx had to keep working because external websites were linking to it. I also added a 3rd URL-format (that is preferred) to access the same document.
- http://mysite/documents/document.ashx?d=123 : the actual handler
- http://mysite/documents/document.aspx?d=123 : gets rewritten to document.ashx
- http://mysite/documents/123.pdf : gets rewritten to document.ashx
The technique I used was this: in Global.asax (I can't remember the method name) I check the requested URL via regular expressions and redirect or rewrite the URL. I also check for regular files (if they exist). In IIS, all file extensions are now handled by the ASP.NET process and everything goes through my Global.asax. This is what I like about ASP.NET: its modular architecture where you can customize pretty much everything. I don't like WebForms, but the architecture with HTTP modules and handlers is awesome.