简体   繁体   中英

URL rewrite rule is not working in IIS?

I have below condition with I suppose to redirect to google.com. Looks like it is not firing when I tried http://dev.domain.com/iapps/ebiz .

Is there anything wrong in the rule?

    <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>

Try:

<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 matches is without protocol and domain name in condition.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM