using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace ceshi { public class Class1:IHttpModule { public void Dispose() { throw new NotImplementedException(); } public void Init(HttpApplication context) { context.BeginRequest += new EventHandler(context_BeginRequest); } void context_BeginRequest(object sender, EventArgs e) { HttpApplication app = (HttpApplication)sender; String u = app.Context.Request.Url.AbsolutePath; if (u.IndexOf(".html") > 0) { app.Context.RewritePath("WebForm1.aspx"); } else { app.Context.RewritePath("GenericErrorPage.htm"); } } } } URL中后缀含有.html的请求都将转向到特定页面,利用这种方式可以来回重写,如果你喜欢A页重写到B页重写到C页重写到D页...