Recommended
<script><br>function isMatch(str1, str2) <br>{ <br>var index = str1.indexOf(str2); <br>if(index==-1) return false; <br>return true; <br>} <br>alert(window. location.hostname);<br>if (isMatch(window.location.hostname,'www.jb51.net') == false){window.location.href="http://www.jb51.net";} <br></script>
The following is used in one of our website development
function gotourl()
{
var url = "http://www.jb51.net";
var localurl = document.url;
if( localurl.substring(0,url.length) != url )
{
location.href=url;
}
}
gotourl();