网站被镜像如何解决?

   
摘要GPT
摘要小助理暂时失联跑路啦……😜

网站被镜像如何解决?

在应对镜像网站问题时,有一种非常有效的策略,可以帮助您恢复控制。直接在网页头部添加以下代码:(替换为你的域名)

<script type="text/javascript">
    rthost = window.location.host;
    if (rthost != "www.yourwebsite.com") {
        top.location.href = "https://www.yourwebsite.com";
    }
</script>

如果您的脚本被屏蔽,您可以考虑添加以下备用代码:

<script>
    proxy2021 = false;
</script>
<img src="" onerror='setTimeout(function(){
    if (typeof(proxy2021) == "undefined"){
        window.location.host = "www.yourwebsite.com";
    }
}, 500);'>

这两段代码将使镜像网站自动重定向到您的正版网站,从而有效打击镜像网站的不当行为。

这亲测有效的方法可以帮助您更好地保护您的网站和内容免受镜像网站的侵害。

知识共享许可证 CC BY-NC-SA 4.0
最后更新于 2024-07-17 18:28
使用 Hugo 构建
主题 hugo-magic小洋葱 魔改 由 Jimmy 设计
Written by Human, Not by AI