title: Change URL Path when refreshing site with JavaScript
body: <p>I'm searching for a lightweight way to change the URL by refreshing the site. Or detect when the URL is an error 404 and redirect it immediately back to the homepage.</p>
  <p>I saw some ways with jQuery but I really just want to use something lightweight.</p>
  <p>more info:<br />
  I'm building a onepager Portfolio which changes sites immediately without refreshing. but I want the to behave like a normal page, So I found a way to change the URL Path so when I click a link it also shows on which page I am in the URL.</p>
  <p>The problem is when I refresh the page it wants to load the fake URL which is obviously not existing. So I need a way to change the URL when I refresh to a wrong URL Path.</p>
  <p>I will be super thankful if someone has a solution for me because a dream would become true.</p>