3

我有某些值mappedweb.config文件中用于URL Mapping. 当我浏览文件时,它可以工作localhost。但是,当我在生产上部署此应用程序时IIS,它不会工作。显示错误:“ 404: The resource cannot be found.”不知道为什么?

任何想法?

Web.config 标记:

<urlMappings enabled="true">
      <add url="~/Pune" mappedUrl="~/City.aspx?ID=1"/>
</urlMappings>

在 .aspx 文件中:

<a href="Pune">Pune City</a>

搜索后,我得到了一些线索,它一定是:

<urlMappings enabled="true">
          <add url="~/Pune" mappedUrl="http://mycustomdomain.com/City.aspx?ID=1"/>
</urlMappings>

但是,不幸的是,这也行不通..!

还有什么……我们需要在文件中进行设置IISweb.config

4

2 回答 2

1

看到这个: http: //forums.asp.net/t/1523272.aspx?urlmappings+stopped+when+moved+to+ii7

IIS 7 不应该支持 Url 映射 - 您应该使用Url Rewrite 模块

于 2014-08-08T18:24:13.567 回答
1

为此,只需按照以下步骤操作:

对于 IIS 7: 打开 IIS manager ,双击网站,双击 Handler Mappings ,右键单击特定的处理程序,单击 Request Restrictions 并取消选中复选框 Invoke handler only if request is mapped to。

于 2013-11-11T13:12:24.580 回答