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.
This commit is contained in:
SnapOtter
2026-06-13 11:09:02 +08:00
parent 82991b6a41
commit 47b6984be0
4 changed files with 30 additions and 0 deletions
+1
View File
@@ -9,6 +9,7 @@
<a href="https://www.bestpractices.dev/projects/12881"><img src="https://www.bestpractices.dev/projects/12881/badge" alt="OpenSSF Best Practices"></a> <a href="https://www.bestpractices.dev/projects/12881"><img src="https://www.bestpractices.dev/projects/12881/badge" alt="OpenSSF Best Practices"></a>
<a href="https://github.com/snapotter-hq/snapotter/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-AGPLv3-blue" alt="License"></a> <a href="https://github.com/snapotter-hq/snapotter/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-AGPLv3-blue" alt="License"></a>
<a href="https://github.com/snapotter-hq/snapotter/stargazers"><img src="https://img.shields.io/github/stars/snapotter-hq/snapotter?style=social" alt="Stars"></a> <a href="https://github.com/snapotter-hq/snapotter/stargazers"><img src="https://img.shields.io/github/stars/snapotter-hq/snapotter?style=social" alt="Stars"></a>
<a href="https://snapotter.com"><img src="https://img.shields.io/badge/Website-snapotter.com-blue?logo=googlechrome&logoColor=white" alt="Website"></a>
<a href="https://demo.snapotter.com"><img src="https://img.shields.io/badge/Live%20Demo-Try%20it-blue?logo=googlechrome&logoColor=white" alt="Live Demo"></a> <a href="https://demo.snapotter.com"><img src="https://img.shields.io/badge/Live%20Demo-Try%20it-blue?logo=googlechrome&logoColor=white" alt="Live Demo"></a>
<a href="https://discord.gg/hr3s7HPUsr"><img src="https://img.shields.io/badge/Discord-Join-5865F2?logo=discord&logoColor=white" alt="Discord"></a> <a href="https://discord.gg/hr3s7HPUsr"><img src="https://img.shields.io/badge/Discord-Join-5865F2?logo=discord&logoColor=white" alt="Discord"></a>
<a href="https://github.com/sponsors/snapotter-hq"><img src="https://img.shields.io/badge/Sponsor-pink?logo=githubsponsors&logoColor=white" alt="Sponsor"></a> <a href="https://github.com/sponsors/snapotter-hq"><img src="https://img.shields.io/badge/Sponsor-pink?logo=githubsponsors&logoColor=white" alt="Sponsor"></a>
+5
View File
@@ -0,0 +1,5 @@
/_next/static/*
X-Robots-Tag: noindex, nofollow
/_next/data/*
X-Robots-Tag: noindex, nofollow
View File
+24
View File
@@ -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;
},
};