2012-04-26 30 views
1

私はドメインを変更したので301リダイレクトを実行しようとしています。 windows serverとimを使用して、web.configに次のルールを追加します。複数のweb.configリダイレクトルール

<rule name="redirectDomain" stopProcessing="true"> 
        <match url="(.*)" /> 
        <action type="Redirect" url="http://replacement-cost.net/{R:1}" redirectType="Permanent" /> 
        <conditions logicalGrouping="MatchAny"> 
         <add input="{HTTP_HOST}" pattern="^(www.)?windshield-replacement-cost\.org$" /> 
        </conditions> 
       </rule> 

これは、古いドメインのルートであるページを除いて...これまでのすべてのページが新しいサイトで同じ名前とファイル構造であるとして、[OK]を働いています。今はhttp://replacement-cost.net/windshield-replacement-costにあります

ルートだけをリダイレクトする別のルールを書くことは可能ですか? 2番目のルールは他のすべてのページをリダイレクトしていますか?おそらく実行順序のいくつかの種類? ruleURLISROOT =真>後藤http://replacement-cost.net/windshield-replacement-cost

上記のコードで任意のヘルプをリダイレクトする場合は、この本質的

と同じ結果をacheiveする

何かをいただければ幸いです。それは私だけのこれまでの距離を取得する年齢がかかりました!おかげ

答えて

4

前、既存のルールに追加する必要があります。これは、新しいルールは

<rule name="redirect Root Domain" stopProcessing="true"> 
    <match url="^$" /> 
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> 
     <add input="{HTTP_HOST}" pattern="^(www.)?windshield-replacement-cost\.org$" /> 
    </conditions> 
    <action type="Redirect" url="http://replacement-cost.net/windshield-replacement-cost" /> 
</rule> 

これは、既存のルール

<rule name="redirectDomain" stopProcessing="true"> 
    <match url="(.*)" /> 
    <conditions logicalGrouping="MatchAny" trackAllCaptures="false"> 
     <add input="{HTTP_HOST}" pattern="^(www.)?windshield-replacement-cost\.org$" /> 
    </conditions> 
    <action type="Redirect" url="http://replacement-cost.net/{R:1}" redirectType="Permanent" /> 
</rule> 
+0

パーフェクトです - あなた先生伝説です! – loveforfire33

関連する問題