一步一步太麻烦,直接上代码。网站根目录创建web.config文件,内容为:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
<mimeMap fileExtension=".woff2" mimeType="application/x-font-woff" />
</staticContent>
<rewrite>
<rules>
<rule name="https" patternSyntax="ECMAScript" stopProcessing="true">
<match url="(.*)" negate="false" />
<conditions logicalGrouping="MatchAny" trackAllCaptures="true">
<add input="{HTTPS}" pattern="^OFF$" />
<add input="{HTTPS_HOST}" pattern="^(localhost)" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Temporary" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
rewrite部分
版权说明
本文地址:https://blog.gengchao.cn/post-239.html
未标注转载均为本站远程,转载请注明文章出处:


发表评论