IIS7 Url重写规则正则表达式以创建新路径和条带扩展

时间:2011-02-23 17:34:25

标签: iis-7 url-rewriting url-rewrite-module

如何创建重写规则是为了实现以下目的:

之前:content/release/0.9.html

之后:release-notes/0.9

现在我有:

<rule name="Rewrite rule1 for content">
    <match url="^content/release/(.+)$" />
    <action type="Rewrite" url="release-notes/{R:1}" />
</rule>

如何摆脱“after”输出中的“.html”?

1 个答案:

答案 0 :(得分:3)

试试这个:

<rule name="Rewrite rule1 for content">
    <match url="^content/release/(.+)\.html$" />
    <action type="Rewrite" url="release-notes/{R:1}" />
</rule>