307 redirect rule with Microsoft Rewrite Module 2.0

荒凉一梦 提交于 2019-12-11 08:10:07

问题


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>


来源:https://stackoverflow.com/questions/12622367/307-redirect-rule-with-microsoft-rewrite-module-2-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!