IIS6 和 IIS7 提供的默认文档 URL 的 URL 差异
我正在开发一个带有自制 url 重写 httpmodule 的遗留 cms。该网站已在 IIS6 上运行多年,现在是时候升级到 IIS7 了。
httpmodule 连接到 Application_BeginRequest 并发挥了它的魔力。 我们不在 IIS 中使用通配符路由,但我们设置了一个名为 main.aspx 的默认文档。 main.aspx 确实存在,使 IIS 将请求路由到 isapi.dll,从而触发我们的 httpmodule。这适用于 iis6 和 iis7(经典模式)。
但我们遇到一个问题。我们看到的行为差异:
- IIS6:浏览到
example.com/?tracking=1234
会在我们的 httpmoduleHttpContext.Current.Request.RawUrl
=中产生/main.aspx?tracker=1234
- IIS7:浏览到
example.com/?tracking=1234
在我们的 httpmodule 中产生HttpContext.Current.Request.RawUrl
=/?tracker=1234
在 IIS7 中运行网站时,默认文档丢失。
IIS 提供的 URL 中缺少默认文档给我们带来了问题。有谁知道为什么这种行为发生了变化?
I'm working on a legacy cms with a home-written url-rewrite httpmodule. The site has been running on IIS6 for years and it's now time to upgrade to IIS7.
The httpmodule hooks up to Application_BeginRequest and does it's magic.
We don't use wildcard-routing in IIS, but we have set up a default document called main.aspx. The main.aspx does exist to make IIS route the request to the isapi.dll, thereby triggering our httpmodule. This works in iis6 and iis7 (classic mode).
We get one problem though. The difference in behaviour we're seeing:
- IIS6: browsing to
example.com/?tracking=1234
yields in our httpmoduleHttpContext.Current.Request.RawUrl
=/main.aspx?tracker=1234
- IIS7: browsing to
example.com/?tracking=1234
yields in our httpmoduleHttpContext.Current.Request.RawUrl
=/?tracker=1234
The default document is missing when running the site in IIS7.
This missing default document in the url provided from IIS causes problem for us. Does anyone know why this behaviour has changed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论