Solve the issue by checking if the url is having string "handler=" , if yes then replaced that with the page name in the history state . So when user clicks back he will be automatically getting the Page name without the handler
Code
window.addEventListener("load", function () {
if (window.location.search.includes("handler=")) {
history.replaceState({}, document.title, window.location.pathname);
}
});