Created
December 18, 2022 10:10
-
-
Save slippycheeze/c6a0311ba8dad558d402be28f81c201f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Elite Dangerous: old forum URL redirector - frontier.co.uk | |
// @namespace rimspace.net | |
// @match *://forums.frontier.co.uk/showthread.php/* | |
// @grant none | |
// @run-at document-start | |
// @version 1.0 | |
// @author Daniel Pittman <[email protected]> | |
// @description when you land on an old forum URL, instead redirect to the "modern" equivalent. | |
// does not try and rewrite the URL before you hit the 404 page, though. | |
// ==/UserScript== | |
const rewriter = /showthread[.]php\/(\d+)-([^/]+)$/; | |
let match = null; | |
if ((match = rewriter.exec(document.location.href)) !== null) { | |
document.location.href = `https://forums.frontier.co.uk/threads/${match[2]}.${match[1]}/`; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment