IIS下强制https访问的设置
作者:管理员 来源:互联网 发布时间:2025-09-22 09:54:59 点击数:0
Windows操作系统IIS平台下部署的网站强制https访问的设置:将以下代码加在站点根目录下的web.config的<system.webServer> 节点里即可。
<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" ></match>
<conditions>
<add input="{HTTPS}" pattern="^OFF$" ></add>
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" ></action>
</rule>
</rules>
</rewrite>如下图:

上一篇:Nginx、Apache和IIS的防盗链设置
下一篇:用ffmpeg修改MP4文件头信息让视频边加载边播放
相关内容:
