From b598adf43c97b4f890dc874ad5612243f1500f4c Mon Sep 17 00:00:00 2001 From: Yusef Almamari Date: Wed, 25 Sep 2024 15:18:31 +0400 Subject: [PATCH] Updates --- 404.html | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/404.html b/404.html index 6000a22..bd4160c 100644 --- a/404.html +++ b/404.html @@ -30,27 +30,27 @@ * - For other cases, set `pathSegmentsToKeep` to 0. */ - const pathSegmentsToKeep = 0; // Adjust as needed for your project configuration + var pathSegmentsToKeep = 0; // Adjust as needed for your project configuration - const l = window.location; + var { location } = window; // Construct the new URL - const newUrl = - l.protocol + + var newUrl = + location.protocol + "//" + - l.hostname + - (l.port ? ":" + l.port : "") + - l.pathname + location.hostname + + (location.port ? ":" + location.port : "") + + location.pathname .split("/") .slice(0, 1 + pathSegmentsToKeep) .join("/") + "/?/" + - l.pathname.slice(1).split("/").slice(pathSegmentsToKeep).join("/").replace(/&/g, "~and~") + - (l.search ? "&" + l.search.slice(1).replace(/&/g, "~and~") : "") + - l.hash; + location.pathname.slice(1).split("/").slice(pathSegmentsToKeep).join("/").replace(/&/g, "~and~") + + (location.search ? "&" + location.search.slice(1).replace(/&/g, "~and~") : "") + + location.hash; // Redirect the browser to the new URL - l.replace(newUrl); + location.replace(newUrl);