2016-09-13 15 views

答えて

1

URL書き換えモジュールをインストールします(デフォルトではインストールされません)。 http://www.iis.net/downloads/microsoft/url-rewrite

これを取得したら、web.configのsystem.webServer/rewrite/rulesのルールセクションを設定できます。このルールを追加:

<rule name="Redirect www to domain" stopProcessing="true"> 
     <match url="(.*)" /> 
     <conditions logicalGrouping="MatchAny" trackAllCaptures="false"> 
      <add input="{HTTPS}" pattern="^OFF$" /> 
      <add input="{HTTP_HOST}" pattern="^www.example.com" /> 
     </conditions> 
     <action type="Redirect" url="https://example.com/{R:1}" /> 
</rule> 
+0

これはルートURLでのみ機能します。すべてのルートではありません。 – Brian

+0

私は他のルールを持っていて、それを一番上に置き、stopProcessing = "false"を設定しなければならないことを認識しました。 – Brian

関連する問題