【发布时间】:2019-01-23 07:40:45
【问题描述】:
我正在使用 web.config 将所有非 www 重定向到运行正常的 www。如何添加规则以忽略所有子域,以便 http://example.com 重定向到 http://www.example.com 但任何子域 http://*.example.com 或 http://one.example.com 不重定向到 www。 (我无法添加子域列表)。
<rule name="Redirect to www">
<match url=".*" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="^(www\.)(.*)$" negate="true" />
</conditions>
<action type="Redirect" url="http://www.{HTTP_HOST}" redirectType="Permanent"/>
</rule>
【问题讨论】:
标签: azure redirect azure-web-app-service