title: Make link for last page visited in current website?
body: <p>How can I make a link which goes to the last page visited which was part of the current site? </p>
  
  <p>Another way of saying this is, I need a link which is like the browser back button, unless the last page visited was a different website. If this is the case the link could either go to the last page on the current site that was visited, or an arbitrary back up could be used.</p>
  
  <p>UPDATE. Would javascript be the easiest solution? The code below works as a back button:
   [Go Back]</p>
  
  <p>So, could I add some logic that made it work as normal if the last page was part of the current site, and provided a back up if the last page visited wasn't from my site? 
  Thanks </p>