[英]IIS Url Rewrite - How to prevent IIS accepting subdomain wildcard prefix xyz.domain.com in URL rewrite section
我提供了将网站流量从非wwww / http重定向到www / https路径的规则。 我输入了以下规则:
<rule name="Redirect to www" enabled="true" patternSyntax="ECMAScript" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^myway.com" />
</conditions>
<action type="Redirect" url="https://www.myway.com/{R:0}" />
</rule>
<rule name="All to https" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" />
</rule>
它适用于所有网络流量,但它也接受域名中的通配符,例如输入ww.domain.com,myname.domain.com也将链接到该站点,并且浏览器会提示SSL证书警告。
我需要添加/编辑规则吗?
由于domain.com与www.domain.com不匹配,因此不会进行SSL连接。 而且由于HTTP重定向只能在建立SSL连接后才能完成,因此将无法进行重定向。 您唯一的机会就是获得包含domain.com和www.domain.com的证书。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.