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文件頭信息讓視頻邊加載邊播放
相關內容:
