1// similar behavior as an HTTP redirect
2window.location.replace("http://stackoverflow.com");
3
4// similar behavior as clicking on a link
5window.location.href = "http://stackoverflow.com";
1// similar as an HTTP redirect, page will be not in browser history
2window.location.replace("/replaced.html");
3
4// similar as clicking on a link, page will be on history :-)
5window.location.href = "/replaced.html";
6
1window.location.href = "https://your_website.php/page2.php;
2// to remove actual address from the history:
3window.location.replace = "https://your_website.php/page2.php;