希望工程boss 发表于 2020-4-24 12:24:28

windows服务器IIS6 自动跳转到HTTPS配置教程

windows服务器IIS6 自动跳转到HTTPS配置教程

1. IIS6中,站点属性-》目录安全性-》编辑中把“要求安全通道(SSL)”勾选上即可。


2. 打开自己网站根目录, 例如 d:webroot,在根目录新建一个名为https.htm 的文件,内容如下:
<html>
<head><title>Redirecting...</title></head>
<script language="JavaScript">
function redirectHttpToHttps()
{
   varhttpURL= window.location.hostname + window.location.pathname +window.location.search;
   var httpsURL="https://" + httpURL;
   window.location= httpsURL;
}
redirectHttpToHttps();
</script>
<body>
</body>
</html>

3.IIS6中, 站点属性 -》 自定义错误 -》选择 403.4 -》修改文件路径为d:/webroot/https.htm

页: [1]
查看完整版本: windows服务器IIS6 自动跳转到HTTPS配置教程