Вы можете использовать собственный httpmodule следующим образом:
public class CheckRealHtmlFile : System.Web.IHttpModule
{
public void Dispose()
{
}
public void Init(System.Web.HttpApplication context)
{
context.BeginRequest += new EventHandler(context_BeginRequest);
}
void context_BeginRequest(object sender, EventArgs e)
{
System.Web.HttpApplication app = sender as System.Web.HttpApplication;
if (app != null)
{
System.Text.RegularExpressions.Regex rHtml = new System.Text.RegularExpressions.Regex(@"\.html$", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
if (rHtml.IsMatch(app.Context.Request.Url.AbsolutePath) && !System.IO.File.Exists(app.Context.Server.MapPath(app.Context.Request.Url.AbsolutePath)))
{
//Execute your html -> aspx logic
}
else
return;
}
else
return;
}
}