Old Reddit Redirect (with Funny Hat fix)

Redirect any new reddit url except for "/media", "/gallery" or "/poll" to old reddit. Fixes the "Funny Hat" redirect.

  1. // ==UserScript==
  2. // @name Old Reddit Redirect (with Funny Hat fix)
  3. // @namespace http://asleepysamurai.com
  4. // @version 0.1
  5. // @description Redirect any new reddit url except for "/media", "/gallery" or "/poll" to old reddit. Fixes the "Funny Hat" redirect.
  6. // @author Balaganesh Damodaran
  7. // @match https://www.reddit.com/*
  8. // @match https://reddit.com/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=reddit.com
  10. // @grant none
  11. // @license BSD Zero Clause License
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. if(!['/gallery','/media','/poll'].find(pathPrefix => window.location.pathname.toLowerCase().startsWith(pathPrefix))){
  18. window.location.host = 'old.reddit.com'
  19. }
  20. })();