javascript how to change url and then change back code example
Example 1: java script change url without reload
window.history.replaceState({}, '','/dashboard');
Example 2: javascript change url
history.pushState({}, null, newUrl);
window.history.replaceState({}, '','/dashboard');
history.pushState({}, null, newUrl);