IIS 7忽略没有文件扩展名的MapPageRoute [英] IIS 7 ignores MapPageRoute without file extensions

查看:125
本文介绍了IIS 7忽略没有文件扩展名的MapPageRoute的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目,我想使用asp.net路由功能。因此我在global.asax Application_start中添加了一些路由。

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.

这在我的Windows 7 SP1上工作正常,但是当我将应用程序部署到我的W2K8 R2 Live Server时我只使用URL时获得404。如果我在URL的末尾添加/default.aspx,则页面会正确显示。

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.

IIS似乎忽略没有文件扩展名的URL。

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

在本地服务器上工作但在Live服务器上使用404:

Working on Local Server but 404 on Live server:

http://website/list/123/Test  

在两台服务器上工作:

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

如何让Live服务器使用扩展名更少网址?

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

推荐答案

Don'忘记在web.config文件中添加以下内容

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

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

这篇关于IIS 7忽略没有文件扩展名的MapPageRoute的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆