use replaceState instead of pushState and add construct full URLs better.