TL;DR If you’re working on a site that will only use Ajax calls on some pages, but where you still want to have functional URLs, then use replaceState() for the first URL you add to history. This will let you navigate back to the previous page, if needed. For the other Ajax calls, use pushState(). […]