Single page app history handler