Old Reddit Is Back

Redirects reddit links to old.reddit

// ==UserScript==
// @name         Old Reddit Is Back
// @namespace    https://greasyfork.org/en/users/1045307-seamless
// @description  Redirects reddit links to old.reddit
// @author       SeaMLess
// @include      *://www.reddit.com/*
// @exclude      *://www.reddit.com/poll/*
// @version      1.0.2
// @license      GPL-3.0-or-later; https://www.gnu.org/licenses/gpl-3.0.txt
// @run-at       document-start
// @icon         https://i.ibb.co/QrzsjPV/icon.png
// ==/UserScript==

(function() {
    'use strict';
    const oldURL = window.location.href.replace("www", "old");
    if (window.location.href === oldURL) return;
    try {
        window.location.replace(oldURL);
    } catch (error) {
        console.error("Error redirecting to old Reddit:", error);
    }
})();