admin 发表于 2018-12-4 11:58:37

IIS6如何设置制作SSL网站?

第一步: IIS6中,站点属性-》目录安全性-》编辑中把“要求安全通道(SSL)”勾选上即可。
第二步:打开自己网站根目录, 例如 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>
第三步:IIS6中, 站点属性 -》 自定义错误 -》选择 403.4 -》修改文件路径为d:\webroot\https.htm
第四步:确定,根目录的权限有:network service的可读权限。否则会提示以下错误:
Secure Channel Required
This Virtual Directory requires a browser that supports the configured encryption options.

此法未见效,有待改进!!!

admin 发表于 2018-12-4 13:11:55

脚本更换:

上文的脚本也可以更换成以下:
<HTML><HEAD><TITLE></TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=utf-8">
</HEAD><BODY>
<script type="text/javascript">
var url = window.location.href;
if (url.indexOf("https") < 0) {
url = url.replace("http:", "https:");
window.location.replace(url);
}
</script>
</BODY></HTML>

admin 发表于 2018-12-4 13:13:32

支持http与https的办法

IIS6中,站点属性-》目录安全性-》编辑中把“要求安全通道(SSL)”不要勾选,就可以实现http://与https://
同时根据http与https实现不同的编程,更自由。

admin 发表于 2018-12-4 13:15:33

IIS7的操作类似,这里不再讨论。
页: [1]
查看完整版本: IIS6如何设置制作SSL网站?