我在 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?
发布评论
评论(1)
确保未选中 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