IIS URL書き換えを使用して、ユーザーを非WWWではなくWWWドメインに移動しようとしています。次の正規表現を使用してドメイン名を照合する記事に出くわしました。
^[^\.]+\.[^\.]+$
どの種類のドメインがこの正規表現と一致しているかわかりません。コードの完全な部分は次のとおりです。
<rule name="www redirect" enabled="true" stopProcessing="true">
<match url="." />
<conditions>
<add input="{HTTP_HOST}" **pattern="^[^\.]+\.[^\.]+$"** />
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="http://www.{HTTP_HOST}/{R:0}" />
</rule>
<rule name="www redirect https" enabled="true" stopProcessing="true">
<match url="." />
<conditions>
<add input="{HTTP_HOST}" **pattern="^[^\.]+\.[^\.]+$"** />
<add input="{HTTPS}" pattern="on" />
</conditions>
<action type="Redirect" url="https://www.{HTTP_HOST}/{R:0}" />
</rule>