URL重写规则在IIS中不起作用?

时间:2015-04-13 16:56:37

标签: asp.net asp.net-mvc .htaccess iis

我有以下条件,我想重定向到google.com。当我尝试http://dev.domain.com/iapps/ebiz时,看起来它没有被触发。

规则有什么不妥吗?

    <rewrite>
  <rules>
    <rule name="Redirect With Slash" patternSyntax="ExactMatch" stopProcessing="true">
      <match url="http://dev.domain.com/iapps/ebiz" ignoreCase="true" />
      <conditions>
      </conditions>
      <action type="Redirect" url="http://dev.domain.com/iapps/ebiz/" />
    </rule>
  </rules>
</rewrite>

1 个答案:

答案 0 :(得分:0)

尝试:

<rewrite>
  <rules>
    <rule name="Redirect With Slash" patternSyntax="ECMAScript" stopProcessing="true">
      <match url=".*?iapps/ebiz$" ignoreCase="true" />
      <conditions>
      </conditions>
      <action type="Redirect" url="http://dev.domain.com/iapps/ebiz/" />
    </rule>
  </rules>
</rewrite>

URL匹配条件没有协议和域名。