luanti-org/luanti-org.github.io

Broken legacy forum link redirection

Closed this issue · 0 comments

http://minetest.net/forum/viewtopic.php?id=4345 (link found in the glooptest mod) redirects to
https://forum.luanti.org/viewtopic.php?id=4345 (not found), whereas
https://forum.luanti.org/viewtopic.php?t=4345 shows the correct post.

Maybe relevant code: (didn't test)

<script>
// Forum URL redirection
const urlParams = new URLSearchParams(window.location.search.slice(1));
if (urlParams.has('id')) {
// Convert to a number for security (only numeric values make sense anyway)
const topicId = Number(urlParams.get('id'));
window.location.replace(`https://forum.luanti.org/viewtopic.php?id=${topicId}`);
}
</script>