1

IIS Url Rewrite を初めて使用します。インストールし、IIS を使用してルールを設定しましたが、localhost の URL にアクセスしようとしても何も起こりません。以下は、IIS が私の web.config に入れたものです。この URL mysite/srcc_development_2012/login/default.aspx にアクセスすると、設定したルールに基づいて Google にリダイレクトされますが、機能しません。私は何が欠けていますか?

    <rewrite>
        <rules>
            <rule name="SRCC" patternSyntax="Wildcard" stopProcessing="true">
                <match url="mysite/srcc_development_2012/*" />
                <action type="Redirect" url="http://www.google.com" />
                <conditions logicalGrouping="MatchAny">
                </conditions>
            </rule>
        </rules>
    </rewrite>
4

2 に答える 2

2

i know this is an older thread but it is unanswered and shows up in the search..

here is how i would do this:

<rewrite>
  <rules>
    <rule name="SRCC" stopProcessing="true">
      <match url="(.*)" ignoreCase="true" />
      <conditions>
        <add input="{URL}" pattern="^srcc_development_2012(.*)?" />
      </conditions>
      <action type="Redirect" url="http://www.google.com" />
    </rule>
  </rules>
</rewrite>

The value in is what comes after the domain (stackoverflow.com/THIS/IS/THE-URL, where stackoverflow.com is the {HTTP_HOST} (but we arent using that for this rule)).

于 2014-06-05T13:59:09.790 に答える