IIS6 和 IIS7 提供的默认文档 URL 的 URL 差异

发布于 2024-12-27 20:23:50 字数 714 浏览 2 评论 0原文

我正在开发一个带有自制 url 重写 httpmodule 的遗留 cms。该网站已在 IIS6 上运行多年,现在是时候升级到 IIS7 了。

httpmodule 连接到 Application_BeginRequest 并发挥了它的魔力。 我们不在 IIS 中使用通配符路由,但我们设置了一个名为 main.aspx 的默认文档。 main.aspx 确实存在,使 IIS 将请求路由到 isapi.dll,从而触发我们的 httpmodule。这适用于 iis6 和 iis7(经典模式)。

但我们遇到一个问题。我们看到的行为差异:

  • IIS6:浏览到 example.com/?tracking=1234 会在我们的 httpmodule HttpContext.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 httpmodule HttpContext.Current.Request.RawUrl = /main.aspx?tracker=1234
  • IIS7: browsing to example.com/?tracking=1234 yields in our httpmodule HttpContext.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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文