【发布时间】:2016-05-12 11:26:50
【问题描述】:
我想将 url 中提及的任何单词替换为其他内容:
例如,以下内容:
"something/abc/342", "abc/hithere/something/2"
将改写为:
"REPLACED/abc/342", "abc/hithere/REPLACED/2"
我不完全确定它是如何工作的,但它可能看起来像这样:
<rewrite>
<rules>
<rule name="Rewrite something to REPLACED">
<match url="^/(something)/gi" />
<action type="Rewrite" url="{putbackinanything}REPLACED{putbackinanything}" />
</rule>
</rules>
</rewrite>
【问题讨论】:
标签: c# url-rewriting