I have 3 domains - A.com, B.com, C.com (we can simulate this using tunnels)
The first domain has the pages index.html
and page2.html
Here is the homepage of A.com
<head>
<title>Domain A page 1</title>
</head>
<body>
<h1>Domain A page 1</h1>
<a href="/page2.html">Click here to go to page 2</a>
</body>
page2 will automatically send the buyer to domain B.com
<body>
<h1>Domain A page 2</h1>
<a href="https://B.com">Click here to go to domain B</a>
</body>
<script>
history.pushState({}, "", window.location.href);
window.location.assign("https://B.com");
</script>
The second domain B.com has a page (index.html) that automatically redirects to the third domain C.com
<head>
<title>Domain B page 1</title>
<script>
function goToC() {
console.log("Redirecting to the C page using form...")
document.getElementById("p").submit();
}
</script>
</head>
<body>
<h1>Domain B page 1</h1>
<form id="p" method="get" action="https://C.com">
</form>
<button onclick="goToC()">Click here to go to domain C</button>
<script>
goToC();
</script>
</body>
And finally there is nothing special in C.com
<head>
<title>Domain C page 1</title>
</head>
<body>
<h1>Domain C page 1</h1>
<p>Domain C page 1</p>
</body>
So the user action sequence is
- Go to A.com/index
- Click on link to go to A.com/page2.html
- Get automatically sent to B.com
- Get automatically sent to C.com
On pressing the back button at C.com they come back to A.com/index bypassing A.com/page2 and B.com
How do I ensure that on pressing the back button they come back to A.com/page2 and not A.com/index ? I've tried using the history API but doesn't seem to solve the problem.