【发布时间】:2013-09-15 10:37:38
【问题描述】:
我正在我的项目中实现 URL 重写。 我添加了使用 URL 重写从 IIS 重写的规则。 下面是我添加规则的 web.config 文件的代码:
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<rewrite>
<rules>
<rule name="URLRedirect" stopProcessing="true">
<match url="^([a-z0-9/]+).aspx$" />
<action type="Redirect" url="{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
但问题是我已经编写了删除扩展名的规则,即 .aspx,我希望我的 URL 看起来像
http://localhost:58370/URLRedirect/Default.
但现在它显示为http://localhost:58370/URLRedirect/
这个问题怎么解决.....
【问题讨论】:
标签: c# url-rewriting