IIS中不好用 Url Rewrite

冬海大盗 2009-09-03 05:14:40
小弟我在VS2008中用C# asp.net写了一个程序,里面有 Url Rewrite 进行地址重写,在VS中调试好用,可是我把程序发布到iss中时就不好用了,请大家帮帮忙。小弟谢过了。
...全文
73 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
snkfdy003 2009-09-03
  • 打赏
  • 举报
回复
添加映射 把确认文件是否存在去掉
itrefer 2009-09-03
  • 打赏
  • 举报
回复
你测试访问的是不是index.html页面吧?
igelf 2009-09-03
  • 打赏
  • 举报
回复
iis里,添加html的映射.
itrefer 2009-09-03
  • 打赏
  • 举报
回复
为什不用html到aspx的映射
冬海大盗 2009-09-03
  • 打赏
  • 举报
回复
这是我在web.config中写的
<rewrite url="~/index/index.html" to="~/index/default.aspx" />
<rewrite url="~/index/news.html" to="CompnayNews.aspx?NewsClassID=0" />
<rewrite url="~/index/news-(.+).html" to="CompnayNews.aspx?NewsClassID=$1"/>
<rewrite url="~/index/ShowNews-(.+).html" to="ShowNews.aspx?NewsID=$1"/>
<rewrite url="~/index/Warning.html" to="Warning.aspx?From=navigator&WarningClassID=0" />
<rewrite url="~/index/Warning-(.+).html" to="Warning.aspx?From=left&WarningClassID=$1" />
<rewrite url="~/index/ShowWarning-(.+).html" to="ShowWarning.aspx?ID=$1" />
而放程 序放到IIs中就提示找不到页的错误。
而在VS中测试就能访问。
JGood 2009-09-03
  • 打赏
  • 举报
回复
估计是没有在iis里映射后缀。
用vs进行调试的时候,所有的 请求 都会被提交到clr进行处理的。
Jelindu 2009-09-03
  • 打赏
  • 举报
回复
路径问题,你把你配置的url贴出来!
  • 打赏
  • 举报
回复
问题说清楚!~
kingkongzhang 2009-09-03
  • 打赏
  • 举报
回复
咋回事啊?具体情况发上来看看呗
冬海大盗 2009-09-03
  • 打赏
  • 举报
回复
没人知道吗??
chenyunkun2008 2009-09-03
  • 打赏
  • 举报
回复
沙发,顶

62,039

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧