Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall
When your site is bound to a number of domain names, want to let other domain name jump to a domain name, but also want the domain name after the URI address unchanged. That is to
http://www.xxxxxx.com/aa/aa.php?abc=123#456
http://www.yyyyyy.net/aa/aa.php?abc=123#456
http://www.zzzzzz.net/aa/aa.php?abc=123#456 When multiple domain names are automatically converted to
http://www.4181.cn/aa/aa.php?abc=123#456
I have not found the relevant methods on the Internet, and then self-study PHP, access to JavaScript, just know to achieve this function is very simple, PHP write this function can only be used for PHP programs, so I provide JavaScript code to achieve this function, Hope to give a little help to the novice friend who needs this code. In fact, this code is also very simple, using only JavaScript Location objects and if statements.
<script language= "javascript" type= "Text/javascript" >
<!--
var abc = "www.4181.cn";
var qwe = Window.location.host;
if (qwe!= ABC) {
window.location = "http://" + ABC + window.location.pathname + window.location.search + window.location.hash;
}
-->
</script>
Place the above code between <head></head> (note: replace my domain name with your own domain name).