2016-04-30 8 views
0

オンラインで解決策が見つからないような問題があります。すべての検索は、httpからhttpsまで、またはwwwからwww以外のものですが、httpを前に付けずに行われます。IISがhttps://domain.comからhttps://www.domain.comにリダイレクトしない

私のサイトはhttps://domain.comhttps://www.domain.comにリダイレクトしません。 domain.comはwww.domain.comにリダイレクトされますが、httpsがすでに入力されている場合にのみリダイレクトされず、エラーが発生します。

私はhttpをhttpsにリダイレクトするためにこれを持っている:

<rule name="HTTP to HTTPS redirect" stopProcessing="true"> 
    <match url="(.*)" /> 
     <conditions> 
       <add input="{HTTPS}" pattern="off" ignoreCase="true" /> 
     </conditions> 
    <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" /> 
</rule> 

編集:実験後に、それが正しくhttps://www.domain.comに(SなしからSとWWWでのすなわち)をhttp://domain.comをリダイレクトするために管理しています。 >サイトIISでホスト名フィールド」www.domain.comの除去、最も重要な

<rule name="Force WWW and SSL" enabled="true" stopProcessing="true"> 
    <match url="(.*)" /> 
    <conditions logicalGrouping="MatchAny"> 
     <add input="{HTTP_HOST}" pattern="^[^www]" /> 
     <add input="{HTTPS}" pattern="off" /> 
    </conditions> 
    <action type="Redirect" url="https://www.domain.com/{R:1}" appendQueryString="true" redirectType="Permanent" /> 
</rule> 

そして:

はなおさらhttps://www.domain.com

答えて

0

からhttps://domain.comからは、これを追加した後、それを考え出していませんバインディング>編集>ホスト名を選択し、「サーバー名の表示が必要です」を選択解除します。ここにドメインを入力すると、上記のコードが動作しなくなりました。私はもともとこれが必要だと思っていたが、そうではなかった。

関連する問題