From 47b6984be0c8d8de07e0770a34d61a9795b71eaf Mon Sep 17 00:00:00 2001 From: SnapOtter Date: Sat, 13 Jun 2026 11:09:02 +0800 Subject: [PATCH] fix(landing): add www redirect, noindex JS chunks, and website badge Edge worker 301-redirects www.snapotter.com to snapotter.com to stop Google from splitting domain authority. Adds X-Robots-Tag: noindex on /_next/static/ and /_next/data/ paths to reclaim crawl budget wasted on JS chunks. Adds snapotter.com website badge to README so the highest-authority backlink (GitHub) points to the main site. --- README.md | 1 + apps/landing/public/_headers | 5 +++++ apps/landing/public/_redirects | 0 apps/landing/public/_worker.js | 24 ++++++++++++++++++++++++ 4 files changed, 30 insertions(+) create mode 100644 apps/landing/public/_headers create mode 100644 apps/landing/public/_redirects create mode 100644 apps/landing/public/_worker.js diff --git a/README.md b/README.md index b2a12d23..f58e5d1e 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ OpenSSF Best Practices License Stars + Website Live Demo Discord Sponsor diff --git a/apps/landing/public/_headers b/apps/landing/public/_headers new file mode 100644 index 00000000..c1325ef9 --- /dev/null +++ b/apps/landing/public/_headers @@ -0,0 +1,5 @@ +/_next/static/* + X-Robots-Tag: noindex, nofollow + +/_next/data/* + X-Robots-Tag: noindex, nofollow diff --git a/apps/landing/public/_redirects b/apps/landing/public/_redirects new file mode 100644 index 00000000..e69de29b diff --git a/apps/landing/public/_worker.js b/apps/landing/public/_worker.js new file mode 100644 index 00000000..7c6fb5bc --- /dev/null +++ b/apps/landing/public/_worker.js @@ -0,0 +1,24 @@ +export default { + async fetch(request, env) { + const url = new URL(request.url); + + if (url.hostname === "www.snapotter.com") { + url.hostname = "snapotter.com"; + return Response.redirect(url.toString(), 301); + } + + const response = await env.ASSETS.fetch(request); + + if (url.pathname.startsWith("/_next/static/") || url.pathname.startsWith("/_next/data/")) { + const headers = new Headers(response.headers); + headers.set("X-Robots-Tag", "noindex, nofollow"); + return new Response(response.body, { + status: response.status, + statusText: response.statusText, + headers, + }); + } + + return response; + }, +};