Answer
jfriend00 is really correct. Using the window.location.replace method will work without affecting the back button.
However, I would like to note that whenever you want to stop creating a page, you have to do more than just! There are several methods to prevent a simple script, such as leaving a frame that works in many modern browsers. Perhaps you can turn off the page, display a message with a link to the full page, something like this. You can also use the X-Frame-Options response header, which tells the browser not to display the page in frame. If you do not take some of these measures, you can click your site.
source share