Skip to content

Commit

Permalink
trying to fix endless redirect loop
Browse files Browse the repository at this point in the history
  • Loading branch information
rajbos committed Aug 21, 2024
1 parent ff1d55a commit ad44478
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions public/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -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('//', '/');
Expand Down

0 comments on commit ad44478

Please sign in to comment.