Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net Url重写模块不支持';不能在IIS 7.5中的经典管道上工作_Asp.net_Iis 7.5_Httpmodule_Url Rewriting_Integrated Pipeline Mode - Fatal编程技术网

Asp.net Url重写模块不支持';不能在IIS 7.5中的经典管道上工作

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;

我编写了一个自定义url重写http模块,该模块在集成的托管pipline应用程序池中可以完美地工作

但当我把它变成经典时,它就停止工作了

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