1

IIS 6 サーバー (Windows 2003 Web サーバー) の web.config から 301 リダイレクトを作成する必要があります。私は Apache サーバー派で、Windows Web サーバーについては何も知りません。FTPからのみサーバーにアクセスできます。

別の質問で次のことを見つけましたが、うまくいかないようです:

<system.webServer>
    <rewrite>
        <rules>
        <rule name="Redirect to WWW" stopProcessing="true">
          <match url=".*" />
          <conditions>
            <add input="{HTTP_HOST}" pattern="^mydomain1.com$" />
          </conditions>
          <action type="Redirect" url="http://www.mydomain2.com"
               redirectType="Permanent" />
        </rule>
      </rules>
    </rewrite>
</system.webServer>

mydomain1.comからmydomain2.comに別のページをリダイレクトする必要があります。 元。mydomain1.com/somenameはmydomain.com/someothernameにリダイレクトする必要 があります。


---- 編集 ----
stackoverflow で別のスレッドを見た後、私の構成は次のようになります。

<system.webServer>
    <rewrite>
        <rule name="rule1">
            <match url="default.aspx"/>
            <action type="Redirect" redirectType="Permanent" url="http://www.mydomain.com/somename/somename.aspx"/>
        </rule>
        <rule name="rule2">
            <match url="somename.aspx"/>
            <action type="Redirect" redirectType="Permanent" url="http://www.mydomain2.com/somename2/somename2.aspx"/>
        </rule>
    </rewrite>
</system.webserver><br>

--- 編集 2 ---- ルートをリダイレクトするためのコード:

4

1 に答える 1