Advertisement
Squito

Redirect to new.reddit.com

Mar 26th, 2024 (edited)
657
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         Redirect Reddit URLs
  3. // @namespace    http://tampermonkey.net/
  4. // @version      0.1
  5. // @description  Redirects all URLs from www.reddit.com to new.reddit.com, preserving everything after the domain name.
  6. // @author       FurballGamer
  7. // @match        *://www.reddit.com/*
  8. // @exclude      *://reddit.com/*
  9. // @exclude      *://www.reddit.com/media*
  10. // @grant        none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14.     'use strict';
  15.  
  16.     // Get the current URL
  17.     var currentUrl = window.location.href;
  18.  
  19.     // Replace 'www.reddit.com' with 'new.reddit.com'
  20.     var newUrl = currentUrl.replace('www.reddit.com', 'new.reddit.com');
  21.  
  22.     // Redirect to the new URL
  23.     window.location.href = newUrl;
  24. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement