Skip to content

Commit

Permalink
Update 404 redirect logic for found versions
Browse files Browse the repository at this point in the history
  • Loading branch information
mdapena authored Oct 17, 2024
1 parent 5c1da25 commit 2f78158
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
// If no version is found, redirect to the oldest documentation version (0.5)
window.location.replace(pathname.replace("/pyventus", "/pyventus/0.5") + search + hash);
} else {
// If a version is found, redirect to the latest 404 page of the documentation
window.location.replace("/pyventus/latest/404" + search + hash);
// If a version is found, redirect to the 404 page of the documentation for that version, including missing path
window.location.replace(`/pyventus/${version}/404?path=${encodeURIComponent(`/${pathname.split('/').slice(3).join('/')}`)}`);
}
})(); // Execute immediately
</script>
Expand Down

0 comments on commit 2f78158

Please sign in to comment.