I know you can do javascript:history.go(-2) to make the user go back 2 pages, however I was curious if it were possible in any way to actually make pressing the back button on the browser go back 2 as well.
I didn’t think something like this was possible until I read: Disable browser's back button
So maybe it is?
If you read that older post more carefully, you’ll see that what the answers are suggesting is not technically disabling the browser’s back button. It’s clearing the cache so that there’s nothing to go back to. It’s a hack to achieve a specific effect.
Because I can’t resist making stupid comparisons…
This difference between disabling the back button and setting the cache so that there’s nothing to go back to is like asking “Can we disable channel 8 on the television.” The answers are not about how to disable the television’s ability to display channel 8. They’re more like talking about how to block the airwaves or blowing up the TV station to achieve the same effect.
The point is, you can’t control the client’s browser in the way you’re asking.