通过js代码实现301跳转的方法:
在对应的网页文件中使用此JS代码可实现301跳转,比如将不带www的域名跳转到带www的域名,代码如下:
<script language=javascript> if (document.domain ==""yisu.com"") this.location = ""http://www.yisu.com"" + this.location.pathname + this.location.search; </script>
<script language=javascript>
if (document.domain ==""yisu.com"")
this.location = ""http://www.yisu.com"" + this.location.pathname + this.location.search;
</script>