I have a page that will only redirect the user to a certain page depending on some parameters. So this page will always redirect the visitor.
The problem is when the visitor arrives on this page using the back button. He/She will just be redirected on the page where he/she just clicked the backbutton.
The context: Three pages: A, B and C
On page A i click a link to go to page B. page B will simply redirect me to page C.
The Problem: Click back on page C. I go to page B for a few seconds but then i’m redirected back to page C
As it should be: On Page C, I want to go to page A when i click the back button.
I thought i could use Request.UrlReferrer but this contains the url of page A
Is there any cross browser sollution that will let me do this?
I would prefer a server side sollution, but I’m open for client side too.
EDIT: I just had the idea that it may be possible to replace the entry in the browser history of page B with page A on the moment when the visitor is redirecet to page C. But i don’t know if this is possible and allowed.
Try this
History.js
History.js gracefully supports the HTML5 History/State APIs (pushState, replaceState, onPopState) in all browsers. Including continued support for data, titles, replaceState. Supports jQuery, MooTools and Prototype. For HTML5 browsers this means that you can modify the URL directly, without needing to use hashes anymore. For HTML4 browsers it will revert back to using the old onhashchange functionality.
https://github.com/browserstate/history.js