This repository has been archived on 2026-01-04. You can view files and clone it, but cannot push or open issues or pull requests.
polyplus/js/site-redirects.js

37 lines
No EOL
627 B
JavaScript

const URLs = [
{
Old: "/games/",
New: "/places/"
},
{
Old: "/shop/",
New: "/store/"
},
{
Old: "/my/referrals",
New: "/my/settings/referrals"
},
{
Old: "/create/?t=",
New: "/create/"
},
{
Old: "/user/",
New: "/users/"
},
{
Old: "/library/",
New: "/models/"
}
]
let Matches = URLs.filter((x) => window.location.pathname.startsWith(x.Old))
if (Matches.length > 0) {
let Match = Matches[0]
window.location.pathname = window.location.pathname.replace(Match.Old, Match.New)
}