【发布时间】:2011-04-04 16:18:08
【问题描述】:
我正在本地 IIS 7.5 上运行一个 .net framework 4 Web 应用程序项目,并安装了 URL Rewrite 2.0 模块。
我的应用程序包含一个名为 sitemap.aspx 的页面。我希望能够将 /sitemap/ 映射到 sitemap.aspx
到目前为止,这是我的代码,但它不起作用。调用 /sitemap 后,我会看到 404 Not Found 错误屏幕。缺少什么?
<rewrite>
<rules>
<rule name="LowerCaseRule1" enabled="true" stopProcessing="true">
<match url="[A-Z]" ignoreCase="false" />
<conditions>
<add input="{URL}" matchType="Pattern" pattern="^.+\.((axd)|(js)|(xaml))$" ignoreCase="true" negate="true" />
</conditions>
<action type="Redirect" url="{ToLower:{URL}}" redirectType="Permanent" />
</rule>
<rule name="RemoveTrailingSlashRule1" stopProcessing="true" enabled="true">
<match url="(.*)/$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Redirect" url="{R:1}" />
</rule>
</rules>
<rewriteMaps>
<rewriteMap name="test">
<add key="/sitemap" value="sitemap.aspx"/>
</rewriteMap>
</rewriteMaps>
</rewrite>
【问题讨论】:
标签: c# asp.net iis-7.5 url-rewriting