我在web.config
文件中有一些与URL映射
相关的映射值
。当我在本地浏览文件时,它可以工作。但是,当我在生产环境中将此应用程序部署到IIS
上时,它无法工作,显示错误:404:找不到资源。
我不知道为什么会这样?
有任何想法吗?
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>
但是,不幸的是这个方法也行不通..!
还有其他的方法吗?我们需要在IIS
或者web.config
文件中进行设置吗?