0

IIS 6.0 - 我已选中“需要安全通道 (SSL)”复选框。

在 HTTP 请求上 - 它正在生成 403 错误,在自定义错误上,我将相同的请求重定向到 HTTPS。

var httpURL = window.location.hostname + window.location.pathname + window.location.search;
var httpsURL = "https://" + httpURL ;
window.location = httpsURL ;

以下是 Javascript 内容:

<!-- beginning of HttpRedirect.htm file -->
<script type="text/javascript">
function redirectToHttps() {
    var httpURL = window.location.hostname + window.location.pathname + window.location.search;
    var httpsURL = "https://" + httpURL ; window.location = httpsURL ; } 
redirectToHttps();
 </script>
 <!-- end of HttpRedirect.htm file -->

当有 HTTP 请求时,我们可以重定向到 HTTPS,如果我们正在重定向,那么状态码应该是 200

在响应仍然是重新调整 403 作为状态代码。可以将其更改为 200 (OK) - 状态代码,因为我们在“Javascript”中处理了 403

IIS 日志:-

2013-10-01 23:59:45 W3SVC1 IP GET / - 80 - IP - 302 0 0
2013-10-01 23:59:50 W3SVC1 IP GET / - 80 - IP - 302 0 0
2013-10-01 23 :59:55 W3SVC1 IP GET / - 80 - IP - 302 0 0

4

0 回答 0