IIS下设置http自动跳转到https

修改以下文件:C:\Windows\Help\iisHelp\common\403-4.htm 替换为以下代码内容:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>该页必须通过安全通道查看</title>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312" />
</head>
<body>
<script type="text/javascript">
var url=window.location.href;
url=url.replace("http:","https:")
window.location.replace(url)
</script>
</body>
</html>

接着,打开IIS》》网站》》属性》》目录安全性》》编辑》》要求安全通道打勾》》确定。 重启IIS。

Enjoy,不加https://,再访问下域名,是不是跳转了?

原文链接:https://yusky.me/iis-http-auto-redirect-https.html,转载请注明出处。
0

评论1

  1. 留个爪印 表示来过~
    hannah 2015-03-02 0 回复
没有账号?注册  忘记密码?