From ad4447883a08ca59242ec449a5002d3d9ed03683 Mon Sep 17 00:00:00 2001 From: Rob Bos Date: Wed, 21 Aug 2024 13:47:54 +0200 Subject: [PATCH] trying to fix endless redirect loop --- public/404.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/public/404.html b/public/404.html index 4974167..769402f 100644 --- a/public/404.html +++ b/public/404.html @@ -21,6 +21,13 @@ basePath = '/copilot-videos/#' + pathname.replace('copilot-videos', ''); } + // get the search up to the first slash or question mark + searchBeginning = search.split(/[/?]/)[0]; + if (basePath.includes(searchBeginning)) { + // Remove the search from the basePath + search = search.replace(searchBeginning, ''); + } + // If there are double slashes anywhere in the url, remove them if (basePath.includes('//')) { basePath = basePath.replace('//', '/');