One of the difficulties I had in migrating was that all my URIs would change. Hopefully I've gotten everything redirecting; I ended up writing a couple of ASPX files to do it. However when I uploaded them and tried them out all I got was the blog home page.

After much puzzling I gave up and emailed the subtext dev list and Steve Harman provided the answer. Subtext implements a bunch of ASP.NET HTTP Modules and Handlers. These bits of code sit in the HTTP request pipeline and process incoming requests, flowing through all the HTTP Modules before ending up with a specific HTTP Handler for that type of request.

A handler is a .NET class that implements the System.Web.IHttpHandler interface and acts as an endpoint for a request, spitting out the XHTML, HTML, RSS or whatever else it is coded for. For those of you familiar with the old ASP way of doing things think of them as ISAPI filters.  For example there's a handler in Subtext for RSS, this handler is configured in web.config to accept all requests that match the regular expression pattern "/rss\.aspx$".

<HttpHandler pattern="/rss\.aspx$" 
Subtext.Framework" handlerType="Direct"/>

Note that only requests which pass through the ASP.NET process can be mapped in such a way so, for example, we can't map to any file extension of .rss because that, by default, doesn't pass through the ASP.NET engine, IIS serves it as a static file. With IIS7 however everything will go through the ASP.NET pipeline and you can insert modules and handlers for every type of file.

Of course this doesn't explain why my redirection pages didn't work. The problem lies in the web.config line

<add verb="*" path="*" 

This is the last HTTP handler Subtext configures  and it maps everything not already handler to the Subtext URL rewriter. So when my pages were hit this catch all handler got them, not the usual ASP.NET handler; and there's the solution.

To add your own .aspx files you need to make sure that <httpHandlers> section in web.config maps your filename, or the directory containing your custom files to the default ASP.NET handler. For example;

<add verb="*" path="displayBlog.aspx" 

will map any call to displayBlog.aspx back to the ASP.NET handler, so making your page run as you would expect. You can also use directories and wildcards in the path parameter, for example;

<add verb="*" path="dotNet/*" 

will map any files in the dotNet directory to the ASP.NET handler.