1

https://internet.dev.local/ KYR url (末尾に / なし) と正確に一致させ、 https://internet.dev.local/ KYR/ (/あり) にリダイレクトまたは書き換えたいと思います。

次のルールを試していますが、 https://internet.dev.local/KYR/Admin/Form/Default.aspx?signup=falseなどの他の URL にも一致しますが、これは間違っています。

どうすればこれを達成できますか?

<rule name="Static redirect" patternSyntax="ExactMatch" stopProcessing="true">
        <match url="https://internet.dev.local/KYR" negate="true" />
        <conditions>
        </conditions>
        <action type="Redirect" url="/Login/?ReturnUrl=/Member/KYR/" redirectType="Permanent" />
      </rule>
4

1 に答える 1

0

ホストとプロトコルをテストする必要がある場合は、グローバルルールではなく、条件に配置する必要があります。
あなたの例に従うと、それは次のようになります:

<rule name="test" patternSyntax="ExactMatch" stopProcessing="true">
  <match url="KYR" />
  <action type="Redirect" url="/KYR/" redirectType="Permanent" />
  <conditions>
    <add input="{HTTP_HOST}" pattern="internet.dev.local" />
    <add input="{HTTPS}" pattern="on" />
  </conditions>
</rule>

urlあなたの質問が言うので、私は行動の中で変更しました:
redirect or rewrite to https://internet.dev.local/KYR/ (with /).

編集:
任意のホスト(SSLの有無にかかわらず)で動作させるには、条件を削除するだけです:

<rule name="test" patternSyntax="ExactMatch" stopProcessing="true">
  <match url="KYR" />
  <action type="Redirect" url="/KYR/" redirectType="Permanent" />
</rule>
于 2013-02-06T15:58:55.653 に答える