我想重定向以下形式的所有URL: https://example.com/foldername/friendlyurl 至 https://example.com/friendlyurl 如何使用web.config中的重定向规则来完成此操作?
答案 0 :(得分:0)
这有效:
<rule name="folderrule">
<match url="(.*)(foldername/)(.*)" />
<conditions>
<add input="{REQUEST_FILENAME}" ignoreCase="true" />
</conditions>
<action type="Redirect" url="{R:1}{R:3}" />
</rule>