ASP.NET URL 路由给出 404 页面

发布于 2024-12-26 13:37:28 字数 778 浏览 3 评论 0 原文

我在 ASP.NET 4 项目中设置了 url 路由,它可以完美地离线工作。然而,现在当它在线时 - 每个通过 url 路由设置的链接都不起作用。

基本上是这样的链接: http://www.domain.com/test/bla

将始终返回 404 - 未找到文件或目录。 您正在查找的资源可能已被删除、名称已更改或暂时不可用

哦,好吧,我决定尝试修复它。我发现以下提示不起作用(并且似乎找不到任何其他提示):

1. 在 web.config 中有以下代码:

<modules runAllManagedModulesForAllRequests="true">

2. 以下本文:http://www.britishdeveloper.co.uk/2010/06/dont-use-modules-runallmanagementmodulesfo.html。没有成功。

3. 将我的服务器管道模式更改为集成。

还是404错误。

有什么想法吗?

I have setup url routing in my ASP.NET 4 project, which works perfectly offline. However, now when it is online - every link which has been setup by url routing doesn't work.

Basically a link like this:
http://www.domain.com/test/bla

Will always return a 404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable
.

Oh well, I decided to try to fix it. I found the following tips which did not work (and can't seem to find any other):

1. Have the following code in the web.config:

<modules runAllManagedModulesForAllRequests="true">

2. Following this article: http://www.britishdeveloper.co.uk/2010/06/dont-use-modules-runallmanagedmodulesfo.html. No succes.

3. Changing my servers pipeline mode to integrated.

Still, 404 errors.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

童话里做英雄 2025-01-02 13:37:28

确保未选中 IIS 中的“验证文件存在”设置(我相信默认情况下是这样),该设置的存在取决于您是由 IIS6(或更低版本)还是 IIS7(或更高版本)托管。

IIS7 - http://blogs.iis.net/bills/archive/2007/05/25/tip-trick-how-to-turn-off-quot-verify-file-exists-quot-in- iis7.aspx

IIS6 - IIS管理器->网站属性->配置->映射 ->验证文件存在复选框

Ensure that the "verify file exists" setting in IIS is not checked (I believe it is by default), where this setting lives depends on whether you're hosted by IIS6 (or less) or IIS7 (or higher).

IIS7 - http://blogs.iis.net/bills/archive/2007/05/25/tip-trick-how-to-turn-off-quot-verify-file-exists-quot-in-iis7.aspx

IIS6 - IIS Manager -> Web Site Properties -> Configuration -> Mappings -> Verify file exists checkbox

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文