IIS 7 ignores MapPageRoute without file extensions

谁说我不能喝 提交于 2019-12-01 15:05:33

问题


I have a Project, where I want to use the asp.net Routing function. Therefore I added some routes in my global.asax Application_start.

This works fine on my Windows 7 SP1, but when I deploy the Application to my W2K8 R2 Live Server I only get 404's when using the URLs. If I add a /default.aspx at the end of the URLs the pages get displayt correctly.

The IIS seems to ignore the URLs without a file extension.

Working on Local Server but 404 on Live server:

http://website/list/123/Test  

Working on both Servers:

http://website/list/123/Test/index.aspx

How can I get the Live server to use the extension less urls?


回答1:


Don't forget to add the following in your web.config file

<system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>


来源:https://stackoverflow.com/questions/5393290/iis-7-ignores-mappageroute-without-file-extensions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!