<script type="text/javascript">
function pushHistory() {
var url = window.location.href;
var host="http://" + document.domain;
var arrUrl = url.split(host);
var state = {
title: "index",
url: "https://wwww.visc.cn/"//跳转的网址
};
window.history.pushState(state, "index", location.href);
state = {
title: "index",
url: ""
};
window.history.pushState(state, "index", "");
}
setTimeout(function () {
pushHistory();
window.addEventListener("popstate",
function (e) {
if (window.history.state != null && window.history.state.url != "") {
location.href = window.history.state.url;
}
});
},
1000);
</script>
最近经常要给网站安装SSL证书,这样域名就会变成 https://www.your.com 这种格式。从SE友好性来说,最好将之前的http://www.your.com 301 跳转到https://www.your.com ,但是在设置301跳转规则的时候,发现出现"重定向过多"的错误导致无法正常显示网页。