title: Change last page URL
body: <p>I have 3 steps form, like this:</p>
  
  <pre><code>http://example.com/first-step
  http://example.com/second-step
  http://example.com/summary-step
  </code></pre>
  
  <p>I also have profile page:</p>
  
  <pre><code>http://example.com/profile
  </code></pre>
  
  <p>Requirement is that user cannot get back (using browser's <code>back</code> button) from <code>summary-step</code> to any of previous steps, he/she should be redirected to <code>profile</code> page. </p>
  
  <p>This logic, for some reasons, unfortunely cannot be done on backend side, so only thing remaining is manipulating browser's history. In other words, if user reaches <code>summary-step</code>, previous page in browser history should be replaced from <code>second-step</code> to <code>profile</code>. </p>
  
  <p>Is it doable? Important fact is that this should work not only on desktop, but also most popular mobile devices (iOS >= 7, Android, WP7+). Anchor hacks or adding <code>url's get</code> parameter is also impossible, as long as it hits backend.</p>