This works with most user script plugins like GreaseMonkey, ViolentMonkey or TamperMonkey:
// ==UserScript==
// @name BackToOldReddit
// @namespace Reddit
// @match *://www.reddit.com/*
// @grant none
// @run-at document-start
// ==/UserScript==
const currentURL = window.document.location.toString();
if(currentURL.includes('//www')) {
const newURL = currentURL.replace('//www','//old');
window.document.location.replace(newURL);
}