Asp.net Url重写模块不支持';不能在IIS 7.5中的经典管道上工作
我编写了一个自定义url重写http模块,该模块在集成的托管pipline应用程序池中可以完美地工作 但当我把它变成经典时,它就停止工作了Asp.net Url重写模块不支持';不能在IIS 7.5中的经典管道上工作,asp.net,iis-7.5,httpmodule,url-rewriting,integrated-pipeline-mode,Asp.net,Iis 7.5,Httpmodule,Url Rewriting,Integrated Pipeline Mode,我编写了一个自定义url重写http模块,该模块在集成的托管pipline应用程序池中可以完美地工作 但当我把它变成经典时,它就停止工作了 protected virtual void BaseModuleRewriter_AuthorizeRequest( object sender, EventArgs e) { HttpApplication app = (HttpApplication) sender;
protected virtual void BaseModuleRewriter_AuthorizeRequest(
object sender, EventArgs e)
{
HttpApplication app = (HttpApplication) sender;
Rewrite(app.Request.Path, app);
}
protected void Rewrite(string requestedPath,HttpApplication app)
{
if (requestedPath.IndexOf('.') == -1)
{
Page page =PageManager.GetPageByAlias(requestedPath.EndsWith("/") ? requestedPath.Substring(0, requestedPath.Length - 1) : requestedPath);
if (page != null)
{
app.Context.RewritePath(page.RelativeUrl == null ? "/Default.aspx?PageId=" + page.Serial : page.RelativeUrl.Substring(1), false);
//app.Session["ThisPage"] = page;
app.Response.StatusCode = 200;
}
else
{
app.Response.StatusCode = 404;
}
}
}
我应该解释一下,“Page”是一个具有“RelativeUrl”和“AliasAddress”属性的数据库实体。
你知道怎么回事吗?你使用的是无扩展URL吗?是的,我只使用无扩展URL。你使用的是无扩展URL吗?是的,我只使用无扩展URL