Skip to content

Instantly share code, notes, and snippets.

@rtm516
Last active May 7, 2025 14:53
Show Gist options
  • Select an option

  • Save rtm516/5e86e2ff0dd135ffa3486138f9ee2a31 to your computer and use it in GitHub Desktop.

Select an option

Save rtm516/5e86e2ff0dd135ffa3486138f9ee2a31 to your computer and use it in GitHub Desktop.
Minecraft Wiki redirect
// ==UserScript==
// @name Minecraft Wiki redirect
// @namespace https://rtm516.co.uk/
// @version 1.1
// @description Redirect old mc wiki to the new site
// @author rtm516
// @match https://minecraft.fandom.com/wiki/*
// @match https://minecraft.gamepedia.com/wiki/*
// @icon https://minecraft.wiki/favicon.ico
// @grant none
// @updateURL https://gist.github.com/rtm516/5e86e2ff0dd135ffa3486138f9ee2a31/raw/Minecraft%2520Wiki%2520redirect.user.js
// @downloadURL https://gist.github.com/rtm516/5e86e2ff0dd135ffa3486138f9ee2a31/raw/Minecraft%2520Wiki%2520redirect.user.js
// ==/UserScript==
document.location.href = document.location.href.replace("minecraft.fandom.com/wiki", "minecraft.wiki/w")
@rtm516
Copy link
Author

rtm516 commented Sep 27, 2023

Should be resolved, thanks

@DelofJ
Copy link

DelofJ commented Jan 21, 2024

The current script is not compatible when the wiki is in another language
I think you should use this instead

// ==UserScript==
// @name         Minecraft Wiki redirect
// @namespace    https://rtm516.co.uk/
// @version      1.1
// @description  Redirect old mc wiki to the new site
// @author       rtm516
// @match        https://minecraft.fandom.com/*
// @match        https://minecraft.gamepedia.com/*
// @icon         https://minecraft.wiki/favicon.ico
// @grant        none
// @updateURL    https://gist.github.com/rtm516/5e86e2ff0dd135ffa3486138f9ee2a31/raw/Minecraft%2520Wiki%2520redirect.user.js
// @downloadURL  https://gist.github.com/rtm516/5e86e2ff0dd135ffa3486138f9ee2a31/raw/Minecraft%2520Wiki%2520redirect.user.js
// ==/UserScript==

region = document.location.href.split("minecraft.fandom.com/")[1].split("wiki/")[0].replace("/", "")
if (region) {
	document.location.href = document.location.href.replace("minecraft.fandom.com/" + region + "/wiki", region + ".minecraft.wiki/w")
} else {
	document.location.href = document.location.href.replace("minecraft.fandom.com/wiki", "minecraft.wiki/w")
}

Btw I'm not used to JavaScript, sorry if it's a bit messy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment