通過js代碼實現301跳轉的方法:
在對應的網頁文件中使用此JS代碼可實現301跳轉,比如將不帶www的域名跳轉到帶www的域名,代碼如下:
<script language=javascript> if (document.domain ==""yisu.com"") this.location = ""http://www.neiyidaogou.com"" + this.location.pathname + this.location.search; </script>
<script language=javascript>
if (document.domain ==""yisu.com"")
this.location = ""http://www.neiyidaogou.com"" + this.location.pathname + this.location.search;
</script>
億速云公眾號
手機網站二維碼
Copyright ? Yisu Cloud Ltd. All Rights Reserved. 2018 版權所有
廣州億速云計算有限公司粵ICP備17096448號-1 粵公網安備 44010402001142號增值電信業務經營許可證編號:B1-20181529