/** * 自动化多域名路由脚本 * 部署方式:将此代码保存为 _worker.js 并上传至 Cloudflare Pages 根目录。 */ export default { async fetch(request, env) { const url = new URL(request.url); const hostname = url.hostname.replace('www.', ''); // 站点内容定义 const sites = { // 站点 A: 1ph52yrvs.com (清新自然生活风) '1ph52yrvs.com': ` 1PH52YRVS - Pure Living
SUSTAINABLE LIFESTYLE

更好生活,
更亮未来。

精选生活必备品

🌿 Nature 01
🍃 Eco 02
🍀 Well 03
`, // 站点 B: 16f3iu2f75.com (暗黑极简摄影风) '16f3iu2f75.com': ` 16F3IU2F75 - Visual Echoes

STUDIO / 16F3IU2F75

捕捉
寂静
之美。

数字光学中的光影交汇,探索视觉的无限边界。

[Image of Minimalist Landscape]
` }; // 检查是否有匹配的域名 if (sites[hostname]) { return new Response(sites[hostname], { headers: { 'content-type': 'text/html;charset=UTF-8' } }); } // 默认回退页面(针对 pages.dev 域名) return new Response(\`

集群网站托管中

当前识别到的域名为: \${hostname}

请确保在 Cloudflare Pages 设置中已绑定该自定义域名。

\`, { headers: { 'content-type': 'text/html;charset=UTF-8' } }); } };