Is it possible to make a 307 redirect rule in web.config with Microsoft Rewrite Module 2.0 for IIS 7? The goal is to redirect some post form requests to another path within the same domain.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Set redirectType attribute of action tag to "Temporary"
Eg.
<rewrite>
<rules>
<rule name="RedirectRule" stopProcessing="true">
<match url="(.*)" ignoreCase="true" />
<action type="Redirect" url="http://www.newdomain.com/{R:1}" redirectType="Temporary" />
<conditions>
<add input="{HTTP_HOST}" pattern="www\.old-domain\.com" />
</conditions>
</rule>
</rules>
</rewrite>