javascript window replace location but add current page to back code example Example: window replace url location.replace("url");