2016-06-30 9 views
0

私は同じUmbracoのアプリケーションを指す2つのドメインがあります。新しいURLに再書き込み古いURL Asp.Net

oldexample.com 
newexample.com 

私は自分のアプリケーションからURLを変更したい:

oldexample.com/... 
TO 
newexample.com/... 

人々はoldexample.comにアクセスします。私のweb.configファイルで

は、私はこれを置いてきましたが、効果なしに:

<rewrite> 
    <rules> 
     <rule name="Redirect old-domain to new-domain" stopProcessing="true"> 
      <match url=".*" /> 
      <conditions> 
       <add input="{HTTP_HOST}" pattern="^oldexample.com$" /> 
      </conditions> 
      <action type="Redirect" url="http://www.newexample.com/{R:0}" appendQueryString="true" redirectType="Permanent" /> 
     </rule> 
     <rule name="WWW Rewrite" enabled="true"> 
      <match url="(.*)" /> 
      <conditions> 
       <add input="{HTTP_HOST}" negate="true" pattern="^www\." /> 
       <add input="{HTTP_HOST}" negate="true" pattern="localhost" /> 
      </conditions> 
      <action type="Redirect" url="http://www.{HTTP_HOST}/{R:0}" appendQueryString="true" redirectType="Permanent" /> 
     </rule> 
    </rules> 
</rewrite> 

私が間違って何をしているのですか?

//このアプリケーションは、AzureのWebサイトでホストされています。両方のURLは、サイトに割り当てられたホスト名です。

答えて

0
<rewrite> 
    <rules> 
    <rule name="Redirect oldexample.com to newexample.com" stopProcessing="true"> 
     <match url="(.*)" /> 
     <conditions logicalGrouping="MatchAny" trackAllCaptures="false"> 
     <add input="{HTTP_HOST}" pattern="^www\.oldexample\.com$" /> 
     <add input="{HTTP_HOST}" pattern="^oldexample\.com$" /> 
     </conditions> 
     <action type="Redirect" url="http://www.newexample.com/{R:1}" /> 
    </rule> 
    </rules>  
</rewrite> 
+1

注:[OLD URL]を入力するときは、** http:// **を含めないでください。動作しないようにしてください。 – Vikrant

関連する問題