title: html5 mode routing in javascript
body: <p>my web application is working on <strong>example.com</strong> and I want to pass an id to it like this <strong>example.com/165165</strong></p>
  
  <p>in angular router we just need <a href="https://stackoverflow.com/questions/16677528/location-switching-between-html5-and-hashbang-mode-link-rewriting">$locationProvider.html5Mode(true)</a>.
  but i am not using any framework or router library.
  is there any simple way to do what angular router does?</p>
  
  <p>I have seen <a href="https://html5demos.com/history/" rel="nofollow noreferrer">HTML5 History API</a> demo which is using <code>history</code> object and listening <code>popstate</code> to watch <strong>url changes</strong>. so you could go <a href="https://html5demos.com/history/first" rel="nofollow noreferrer">https://html5demos.com/history/first</a> through the first link in the <a href="https://html5demos.com/history/" rel="nofollow noreferrer">HTML5 History API</a> but you can not access <a href="https://html5demos.com/history/first" rel="nofollow noreferrer">https://html5demos.com/history/first</a> directly. I want to access it directly.</p>
  
  <p>any help would be appreciated.</p>