how do some websites prevent you from using the ‘back’ button to leave the page?

275 views

Often when I’m googling something I’ll go to a few pages, so I’ll click a link, and then use the back button to return to the search results and find another link. But sometimes the back button just reloads the page, and even tapping it multiple times doesn’t work. How and why do some websites do this? Surely it should be my browser that’s controlling if it goes back or not, rather than the website it’s on?

In: 197

11 Answers

Anonymous 0 Comments

Web dev here:
There’s different kinds of redirects. There’s a “normal” one what gives you ability to go back and forth. And then there’s “replace”, which basically replaces the URL with a new one. Sometimes it is needed for UX. Like if you’re doing a test and accidentally clicked some hotkey to go backwards, your test might fail. To prevent this we would open the test in a new tab and won’t let user to go backwards.

You are viewing 1 out of 11 answers, click here to view all answers.