IIS 7.5 - 在无扩展名的URI的Windows Server 2008 R2 SP1后处理重大更改应用? [英] IIS 7.5 – a breaking change in extensionless URIs handling after Windows Server 2008 R2 SP1 is applied?

查看:152
本文介绍了IIS 7.5 - 在无扩展名的URI的Windows Server 2008 R2 SP1后处理重大更改应用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在经历我们最近从IIS 6迁移.NET 2.0 IIS 7.5中的应用程序出现问题.NET 4.0(ASP.Net Web窗体)

在code执行在Global.asax的Application_BeginRequest事件定制重写,并使用HttpContext.Current.RewritePath()方法做重写。

在一个错误的请求(不存在的页面)与扩展来如/kentest/test.blah事情得到妥善处理 - IIS正确传递中,我们重新定向到自定义错误页。

在一个糟糕的请求到来时没有文件扩展名状/ kentest /测试则IIS不能正常通过自定义错误页。我们会陷入一个循环一遍又一遍地重写同/ kentest /测试,直到IIS抛出一个递归500例外。

任何想法如何解决这个问题,并得到请求没有工作的扩展?

其他似乎都遇到过这个问题,因为这的博客文章中提到但没有解决方案
提供。

更新我们解决了这个问题

我们需要添加以下的处理器部分的web.config中:

 <清除NAME =ExtensionlessUrlHandler  - 集成 -  4.0/>


解决方案

我们需要添加以下的处理器部分的web.config中:

 <清除NAME =ExtensionlessUrlHandler  - 集成 -  4.0/>

We are experiencing a problem with an application we recently migrated from IIS 6 .net 2.0 to IIS 7.5 .net 4.0 (ASP.Net Web Forms)

The code performs custom rewriting in the global.asax Application_BeginRequest event and uses the HttpContext.Current.RewritePath() method to do the re-writing.

When a bad request (a page which does not exist) with an extension comes in like /kentest/test.blah things are handled properly - IIS properly passes in the custom error page which we re-direct to.

When a bad request comes in without a file extension like /kentest/test then IIS does not properly pass the custom error page. We get caught in a loop rewriting the same /kentest/test over and over until IIS throws a recursion 500 exception.

Any ideas how to solve this and get requests without extensions working?

Others seem to have encountered this issue as this blog post mentions but no solution is provided.

Update We Solved This Issue

We needed to add the following to the web.config in the handlers section:

<remove name="ExtensionlessUrlHandler-Integrated-4.0" />

解决方案

We needed to add the following to the web.config in the handlers section:

<remove name="ExtensionlessUrlHandler-Integrated-4.0" />

这篇关于IIS 7.5 - 在无扩展名的URI的Windows Server 2008 R2 SP1后处理重大更改应用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆