Iis .NET web配置
由于证书映射,我在web.config中添加了一条规则Iis .NET web配置,iis,web-config,Iis,Web Config,由于证书映射,我在web.config中添加了一条规则 <configuration> <system.webServer> <rewrite> <rules> <rule name="HTTP to HTTPS redirect" stopProcessing="true"> <match url="(.*)" /> <conditions>
<configuration>
<system.webServer>
<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>
</rules>
</rewrite>
</system.webServer>
</configuration>
但是,我的url没有正确加载
例如https://www.example.com/xyz/five.jpg
在移动和其他应用程序中正确加载
但是,我以前在DB中的URL映射了上面的URL
什么是不加载
http://example.com/xyz/five.jpg
正在加载到https://www.example.com/xyz/five.jpg
而不是https://example.com/xyz/five.jpg
…您使用什么浏览器?在DNS端是否有从非WWW到WWW的重定向?仅上述IIS上的重写规则不会以这种方式更改URL。根据此规则,所有浏览器都会发生这种情况,如果您在web.config中注释掉https重定向规则,然后浏览到http://example.com
它是否会将您重定向到http://www.example.com
?如果是,则意味着您在DNS级别进行了重定向设置。http://example.com
重定向https://www.example.com
而不是https://example.com