Created
October 3, 2026 21:06
-
-
Save danielecook/b15f9d061de3d8df019f001a2d0ef672 to your computer and use it in GitHub Desktop.
reddit.com to old.reddit.com greasemonkey script
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 Old Reddit Redirect | |
| // @namespace https://old.reddit.com/ | |
| // @version 1.0 | |
| // @description Always redirect reddit.com to the equivalent old.reddit.com URL | |
| // @match *://reddit.com/* | |
| // @match *://www.reddit.com/* | |
| // @match *://np.reddit.com/* | |
| // @match *://new.reddit.com/* | |
| // @match *://amp.reddit.com/* | |
| // @match *://i.reddit.com/* | |
| // @exclude *://old.reddit.com/* | |
| // @run-at document-start | |
| // @grant none | |
| // ==/UserScript== | |
| (function () { | |
| 'use strict'; | |
| const path = location.pathname; | |
| // Paths old Reddit can't handle; let new Reddit serve these. | |
| // - /media?url=... image/video viewer links | |
| // - /r/<sub>/s/<id> mobile share links (they redirect to the real | |
| // post URL first, which this script then catches) | |
| // - /poll/, /chat/, /settings/ etc. only exist on new Reddit | |
| const skip = [ | |
| /^\/media\b/, | |
| /^\/r\/[^/]+\/s\//, | |
| /^\/poll\//, | |
| /^\/chat\b/, | |
| /^\/settings\b/, | |
| /^\/appeal\b/, | |
| ]; | |
| if (skip.some((re) => re.test(path))) return; | |
| const target = 'https://old.reddit.com' + path + location.search + location.hash; | |
| location.replace(target); // replace() keeps the back button working | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment