Files
Surge/Surge-main/Modules/Xbox_Rewrite.sgmodule
2026-04-02 21:02:16 +08:00

18 lines
887 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!name=Xbox Rewrite Collection
#!desc=Win 商店链接重定向 & 强制锁美区 (保留阿根廷区)
#!category=XBOX
#!author=Ah Long
[URL Rewrite]
# Microsoft Store -> 对应的 CoreHalo 游戏页(提取 12 位 ID
(?i)^https?:\/\/(?:www\.)?microsoft\.com\/en-us\/store\/.*?([a-z0-9]{12})(?:[\/\?#]|$) https://www.xbox.com/en-us/games/store/corehalo/$1 302
# 非 en-us 的 xbox.com 统一跳转到 en-us排除 es-ar / es-AR / en-us
^https:\/\/www\.xbox\.com\/(?!es-ar|es-AR|en-us)([a-zA-Z]{2}-[a-zA-Z]{2})(\/.*)$ https://www.xbox.com/en-us$2 302
# app.corehalo.com 的 r 区域参数统一改为 en-us保留其他 query 参数
"^https:\/\/app\.corehalo\.com\/ms\/link\/go\?(.*&)?r=(?!es-ar|es-AR|en-us)([a-zA-Z]{2}-[a-zA-Z]{2})(&.*)?$" "https://app.corehalo.com/ms/link/go?$1r=en-us$3" 302
[MITM]
hostname = %APPEND% www.microsoft.com, www.xbox.com, app.corehalo.com