By coding the page state into the URL, even single-page web applications can support deep bookmarks and the browser’s back button. The most accepted approach is to utilize the location hash, i.e. the local part of the URL. This article explains this technique and what pitfalls you should be aware of, based on my team’s experience from building an AJAX interface for Solr. You will also learn about the HTML5 History API, which is a second, more modern technique.