Refactored `replacedUrl` to store the new URL on both `location.replace` and setting `location.href` directly to handle delays in the actual location value change in IE. Closes #2802
fn