xxxxxxxxxx
window.history.replaceState({}, document.title, "/" + "my-new-url.html");
xxxxxxxxxx
//if the url is = https://example.com/#exampleid
var url = document.URL.split('#')[0]
//=> https://example.com/
//redirect it
location = url
xxxxxxxxxx
var b = url.replace(/(?:https?|ftp):\/\/[\n\S]+/g, '');
//=> and I said
xxxxxxxxxx
//Maybe you want to get relative_path
const RELATIVE_PATH = window.location.pathname;
alert(RELATIVE_PATH)
xxxxxxxxxx
window.history.replaceState({}, document.title, "/" + "my-new-url.html");
xxxxxxxxxx
window.history.replaceState({}, document.title, "/" + "my-new-url.html");
xxxxxxxxxx
window.history.replaceState({}, document.title, "/" + "my-new-url.html");
xxxxxxxxxx
window.history.replaceState({}, document.title, "/" + "my-new-url.html");
xxxxxxxxxx
window.history.replaceState({}, document.title, "/" + "my-new-url.html");
xxxxxxxxxx
//if the url is = https://example.com/#exampleid
var url = document.URL.split('#')[0]
//=> https://example.com/
//redirect it
location = url