title: This page isn’t working error when i refresh the page
body: <p>Am trying to send the user to login page, when he clicks browser back button.</p>
  
  <p>I went to some page  <a href="http://example/app/somePage" rel="nofollow noreferrer">http://example/app/somePage</a> 
  here if I refresh the page I am getting page not working error?</p>
  
  <p>My requirement is anywhere user click browser back button should <a href="http://example/app/" rel="nofollow noreferrer">http://example/app/</a> and if he refresh the current page nothing should happen</p>
  
  <pre><code>if (window.history &amp;&amp; history.pushState) {
              addEventListener('load', function() {
                  history.pushState('',"",''); // creates new history entry with same URL
                  addEventListener('popstate', function() {                   
                       window.location='http://localhost:8080/app/';
                   });    
              });
          }
  </code></pre>