How to redirect URL with Modify HTTP Response

Add-ons for Pale Moon and other applications
General discussion, compatibility, contributed extensions, themes, plugins, and more.

Moderators: FranklinDM, Lootyhoof

User avatar
King Si
Moongazer
Moongazer
Posts: 14
Joined: 2025-11-07, 09:05

How to redirect URL with Modify HTTP Response

Post by King Si » 2026-03-06, 05:48

I need to create a script line for palemoon extension
Modify HTTP Response
that redirect a url to another url, specifically:

www.reddit.com
redirect to:
old.reddit.com

can anyone help?
Note: I tried "URL rewriter" but it doesnt do a thing
You do not have the required permissions to view the files attached to this post.

User avatar
adoxa
Astronaut
Astronaut
Posts: 616
Joined: 2019-03-16, 13:26
Location: Qld, Aus.

Re: How to redirect URL with Modify HTTP Response

Post by adoxa » 2026-03-06, 06:56

You haven't specified any wildcards, so it will only redirect that specific URL. You need to append * to the include pattern and $1 to the redirect.

User avatar
laki2
Hobby Astronomer
Hobby Astronomer
Posts: 22
Joined: 2025-04-13, 20:13

Re: How to redirect URL with Modify HTTP Response

Post by laki2 » 2026-03-06, 18:49

Attached is my URL Rewriter config. You should be able to figure it out from here,
url-rewriter.png
This should work:

Code: Select all

Include Pattern: ^https://www\.reddit\.com(.*)
Redirect To: https://old.reddit.com$1
You do not have the required permissions to view the files attached to this post.

User avatar
King Si
Moongazer
Moongazer
Posts: 14
Joined: 2025-11-07, 09:05

Re: How to redirect URL with Modify HTTP Response

Post by King Si » 2026-03-08, 06:21

Thank you so much guys, I am going to set and try, more thanks in advance

User avatar
King Si
Moongazer
Moongazer
Posts: 14
Joined: 2025-11-07, 09:05

Re: How to redirect URL with Modify HTTP Response

Post by King Si » 2026-03-08, 06:48

I changed the pattern as directed, see the screenshot, the base url goes well i.e., "www.reddit.com" to "old.reddit.com", but after that every slash has %2f things , pasted below:

https://old.reddit.comr%2fg502masterrace%2fcomments%2fbwpl21%2fyet_another_person_whos_mouse_stops_working_after%2f/
changes to
https://www.reddit.com/r/G502MasterRace ... ing_after/

https://www.reddit.com/r/AskProgramming ... _and_less/
changes to
https://old.reddit.comr%2faskprogramming%2fcomments%2f1jqmcw9%2fwill_32bit_apps_always_be_faster_and_less%2f/

https://i.redd.it/fp49pew1arng1.png
https://old.reddit.commedia%3furl%3dhttps%3a%2f%2fi.redd.it%2ffp49pew1arng1.png/
You do not have the required permissions to view the files attached to this post.

User avatar
King Si
Moongazer
Moongazer
Posts: 14
Joined: 2025-11-07, 09:05

Re: How to redirect URL with Modify HTTP Response

Post by King Si » 2026-03-08, 07:24

I managed to fic to some extent by hit and try method, so now the url
https://www.reddit.com/r/counterstrike/ ... back_then/
changed to
https://old.reddit.com/r/counterstrike% ... ck_then%2F

the /r/ after the old.reddit.com is now ok but the rest of the link still has %2f (the equivalent of / i guess)

the codes i used is:
Redirect: ^https://www\.reddit\.com/r/(.*) to https://old.reddit.com/r/$1
Example: https://www.reddit.com/r/Windows11 becomes https://old.reddit.com/r/Windows11
can we you make it better by elimination all "%2f" , s i recall this is due to non unicoode stuff??
You do not have the required permissions to view the files attached to this post.

User avatar
adoxa
Astronaut
Astronaut
Posts: 616
Joined: 2019-03-16, 13:26
Location: Qld, Aus.

Re: How to redirect URL with Modify HTTP Response

Post by adoxa » 2026-03-08, 08:25

King Si wrote:
2026-03-08, 07:24
can we you make it better by elimination all "%2f" , s i recall this is due to non unicoode stuff??
Uncheck "Escape matches" (and "Unescape matches", too).

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 5816
Joined: 2015-12-09, 15:45

Re: How to redirect URL with Modify HTTP Response

Post by moonbat » 2026-03-09, 07:36

This is what works for me:
URLrewriter reddit.png
You do not have the required permissions to view the files attached to this post.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
KDE Neon on a Slimbook Excalibur (Ryzen 7 8845HS, 64 GB RAM)
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Jabber: moonbat@hot-chili.net

User avatar
Gemmaugr
Astronaut
Astronaut
Posts: 551
Joined: 2025-02-03, 07:55

Re: How to redirect URL with Modify HTTP Response

Post by Gemmaugr » 2026-03-09, 08:47

Or this GreaseMonkey script:

Code: Select all

// ==UserScript==
// @name        Good old Reddit
// @description	Good old Reddit.
// @version		1.0
// @match       *://www.reddit.com/*
// @exclude      https://*.reddit.com/poll/*
// @exclude      https://*.reddit.com/gallery/*
// @exclude      https://*.reddit.com/media*
// @exclude      https://*.reddit.com/notifications
// @exclude      https://chat.reddit.com/*
// @run-at      document-start
// @grant       none
// ==/UserScript==

if ( window.location.host != "old.reddit.com" ) {
    var oldReddit  = window.location.protocol + "//" + "old.reddit.com" + window.location.pathname + window.location.search + window.location.hash;
    window.location.replace (oldReddit);
}
When voting or viewing polls, I just change old.reddit to sh.reddit
"Judge a person not by their superficial identity attributes, but by the content of their character."
"Organized Identity Politics are the bane of civilized society."
"Cognitive dissonance hypocrisy is a pandemic."
"Capitalism is the worst form of economic system, except for all the others."

User avatar
King Si
Moongazer
Moongazer
Posts: 14
Joined: 2025-11-07, 09:05

Re: How to redirect URL with Modify HTTP Response

Post by King Si » 2026-03-11, 10:13

adoxa wrote:
2026-03-08, 08:25
Uncheck "Escape matches" (and "Unescape matches", too).
Thanks a lot, this helped me and now all reddit pages are clean and going to old.reddit.

@Gemmaugr
yes i will definitely install greasemonkey, you reminded me old days, thanks