asp.net - IIS 7 的 URLRewriter 返回 404 服务器错误

标签 asp.net iis-7 url-rewriting http-status-code-404

我已经从这里实现了“方法 3:使用 HttpModule 通过 IIS7 执行无扩展 URL 重写”: - http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx

即基于URLRewriter模块: - http://urlrewriter.net/

它似乎适用于我的本地环境,但在生产服务器(运行 IIS 7)上它显示“404 - 未找到文件或目录”页面。

我在 Google 上搜索过,但似乎找不到解决方案。

最后,我们回到 IIS 6 并按照此处的说明进行操作: - http://urlrewriter.net/index.php/support/installation/windows-server-2003

但有一天我们可能必须在共享主机环境上升级到 IIS 7,同样的问题会再次出现!

最佳答案

托管人员让它在 IIS 7 中工作。HTTP 处理程序需要使用不同应用程序池的通配符映射才能使其在 IIS 7 中工作。希望这有帮助。

确保您在 Web.Config 中具有以下内容:

<system.webServer>
  <validation validateIntegratedModeConfiguration="false"/>
  <handlers>
    <add name="wildcard" path="*" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
  </handlers>
</system.webServer>

关于asp.net - IIS 7 的 URLRewriter 返回 404 服务器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4134416/

相关文章:

windows - 使用 powershell 遍历在 IIS 中配置的所有绑定(bind)

redirect - 如何重定向并删除 URL 中的 .html 扩展名?

javascript - 使用 javascript 扩展上方的下拉区域而不是下方

c# - 如何使用数据注释设置默认值

asp.net-mvc-2 - Siteminder SSO 不保护 ASP.NET MVC 站点

windows - iis7 默认 mime 类型行为

asp.net - 在 ASP.NET 网站中隐藏页面 URL

ruby - 将 URL 前缀重写为 HTTP header

asp.net - 在 formview 插入命令后重定向

asp.net - Stream.Read 总是返回 0