none.gif

Gosling

GF  2023-10-01 14:48

写了一个浏览南+域名重定向的规则 全部集中到一个域名上

打开不同域名的链接老是要重新登录,于是写了个规则,基于浏览器拓展,不管打开什么域名都会跳转到south-plus.net。也不知道论坛之后有没有人写过。

使用浏览器拓展Header Editor,或任何可以重定向的插件。

首先安装插件,Chrome、Firefox可在拓展商店安装。

打开插件新建规则,名字随便取,【Rule type/规则类型】选择【Redirect request/重定向请求】。

【Match type/匹配类型】选择【Regular expression/正则表达式】。

【Match rules 匹配规则】
https:\/\/[a-z]*\.?(south(?=-plus\.org)|(?<=\.)south|north|east|spring|summer|snow|white|level|least|soul|blue)-plus\.(net|org)\/(.*)

【Redirect to 重定向】
https://www.south-plus.net/$3

保存。完成。

如果偏好其他域名则在匹配规则和重定向中间对调一下。

例如我想跳转north-plus,就将所有north换成south,south换成north:
https:\/\/[a-z]*\.?(north(?=-plus\.org)|(?<=\.)north|south|east|spring|summer|snow|white|level|least|soul|blue)-plus\.(net|org)\/(.*)

https://north-plus.net/$3

1325998.png

楽園の少女

B1F  2023-10-01 19:16
顺便写了个油猴脚本
// ==UserScript==
// @name         Redirect to level-plus.net
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Redirect specific domains to level-plus.net
// @author       You
// @match        *://*.south-plus.net/*
// @match        *://*.north-plus.net/*
// @match        *://*.east-plus.net/*
// @match        *://*.spring-plus.net/*
// @match        *://*.summer-plus.net/*
// @match        *://*.snow-plus.net/*
// @match        *://*.white-plus.net/*
// @match        *://*.level-plus.net/*
// @match        *://*.least-plus.net/*
// @match        *://*.soul-plus.net/*
// @match        *://*.blue-plus.net/*
// @match        *://*.south-plus.org/*
// @match        *://*.north-plus.org/*
// @match        *://*.east-plus.org/*
// @match        *://*.spring-plus.org/*
// @match        *://*.summer-plus.org/*
// @match        *://*.snow-plus.org/*
// @match        *://*.white-plus.org/*
// @match        *://*.level-plus.org/*
// @match        *://*.least-plus.org/*
// @match        *://*.soul-plus.org/*
// @match        *://*.blue-plus.org/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const currentURL = window.location.href;
    const regex = /https:\/\/(?:bbs\.)?(south|north|east|spring|summer|snow|white|level|least|soul|blue)-plus\.(net|org)\/(.*)/
    const match = currentURL.match(regex);

    if (match && !currentURL.startsWith("https://www.south-plus.net")) {
        // 第三个匹配组包含路径
        const newPath = match[3];
        const newURL = `https://www.south-plus.net/${newPath}`;
        window.location.replace(newURL);
    }
})();