http跳转https

发表于 2017-06-06  432 次阅读


搞什么配置文件嘛

<script type="text/javascript">
var targetProtocol = "https:";
if (window.location.protocol != targetProtocol)
window.location.href = targetProtocol +
window.location.href.substring(window.location.protocol.length);
  </script>

完美解决

https跳http反之

然而最后还是用了301重定向

本站文章基于国际协议BY-NA-SA 4.0协议共享;
如未特殊说明,本站文章皆为原创文章,请规范转载。

0

心虽在此,逐梦繁星