IIS 8基于URL地址重定向到HTTPS

问题描述 投票:0回答:1

假设我的服务器IP地址是:http://192.168.1.100(NON SSL) 我的域名是:https://helloserver.com(SSL)

如果有人要通过域qazxsw poi访问我的网站,服务器应该自动重定向到HTTPS。我已经设法通过应用以下规则来完成这项工作

helloserver.com

但是,如果有人从IP地址本身访问该网站,它将给出证书错误,因为IP地址没有证书。

如何修改以下规则,当使用IP地址访问网站时,它将使用HTTP而不是重定向的HTTPS规则

我猜它与<rewrite> <rules> <rule name="HTTP to HTTPS redirect" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTPS}" pattern="off" ignoreCase="true" /> </conditions> <action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{R:1}" /> </rule> 条件有关。

有任何想法吗?

ssl iis config iis-8 server-configuration
1个回答
1
投票
<match url="" />
© www.soinside.com 2019 - 2024. All rights reserved.