IIS 7忽略不的MapPageRoute文件扩展 [英] IIS 7 ignores MapPageRoute without file extentions

查看:95
本文介绍了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服务器我只使用URL时获得404的。如果我在URL的末尾添加/default.aspx页面获得displayt正确。

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  

在两台服务器上工作:

Working on both Servers:

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

我怎样才能获得Live服务器使用扩展少网址吗?

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

推荐答案

不要忘记添加在你的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天全站免登陆