html代码

<!DOCTYPE html>
<html>
<head>
    <title>Redirecting...</title>
    <script>
        // 获取当前域名并替换
        const currentDomain = window.location.hostname;
        const newDomain = currentDomain.replace('qq.com', 'jd.com');
    
        // 执行跳转
        window.location.href = window.location.href.replace(currentDomain, newDomain);
    </script>
    <meta http-equiv="refresh" content="0; url=REPLACE_WITH_NEW_URL">
</head>
<body>
    <p>Redirecting to corresponding JD.com domain...</p>
</body>
</html>

nginx

server {
    server_name ~^(?<subdomain>.+)\.qq\.com$;
    return 301 $subdomain.jd.com$request_uri;
}
最后修改:2025 年 08 月 19 日
如果觉得我的文章对你有用,请随意赞赏