0
HTTPS(現在動作している)とwww(既にURLにない場合)にリダイレクトできる必要があります。URL書き換え - Web.config - HTTPSとwww
URLがでない場合、にはwww
があり、正常に動作します。 URL ががwww
を持っていない場合しかし、それは、そのような私はハードコードにドメインをしたくない、とHTTPHOST
または同等のものを使用したいと思いますhttps://www.www.domain.com
注意として、追加のwww
をリダイレクトし、追加します。
現在の書き換えルール:この正規表現になってしまった
<rule name="Redirect to HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://www.{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>
<rule name="WWW Rewrite" enabled="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" negate="true" pattern="^www\.([.a-zA-Z0-9]+)$" />
</conditions>
<action type="Redirect" url="https://www.{HTTP_HOST}/{R:0}" appendQueryString="true" redirectType="Permanent" />
</rule>
こうすると、http://hostwithoutwww.com URLで二重リダイレクトを実行しているので、 "Httpへのリダイレクト"前の "WWW書き換え"ルールは、 –