2021-02-04 js
方法1
<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>
方法2
<script type="text/javascript"> var selfUrl = window.location.href; if (-1 < selfUrl.indexOf('http://')) { selfUrl = selfUrl.replace('http://', 'https://'); window.location.href = selfUrl; } </script>
标签:
赞赏
发表评论