From d2187ae76d26bf4ba5cc79fe193472cb6a6562b4 Mon Sep 17 00:00:00 2001 From: idanlodzki Date: Sun, 30 Aug 2026 22:58:56 +0300 Subject: [PATCH] fix(seo): stop serving the homepage for unknown URLs, drop junk from sitemap The SPA catch-all rewrite in vercel.json sent every filesystem miss to /index.html, so any nonexistent docs URL answered 200 with the homepage instead of 404: $ curl -o /dev/null -w '%{http_code}' https://docs.opsimate.dev/this-page-does-not-exist-xyz123 200 Google records those as soft 404s and spends crawl budget on them. The rewrite was never needed -- Docusaurus emits a prerendered directory per route and Vercel resolves clean URLs from the filesystem on its own, which is why real pages have always served their own content while only misses fell through. Removing it also lets the generated 404.html, which the build still produces, actually be served. Also excludes /search from the sitemap (an empty Algolia results page, currently reported as "Crawled - currently not indexed") and deletes the leftover `markdown-page` Docusaurus template, which was a public URL and a sitemap entry with boilerplate content. Sitemap: 37 -> 35 URLs. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01WaRCnbZLKMeMMYx4nsUgyS --- opsimate-docs/docusaurus.config.js | 5 +++++ opsimate-docs/src/pages/markdown-page.md | 7 ------- opsimate-docs/vercel.json | 3 --- 3 files changed, 5 insertions(+), 10 deletions(-) delete mode 100644 opsimate-docs/src/pages/markdown-page.md diff --git a/opsimate-docs/docusaurus.config.js b/opsimate-docs/docusaurus.config.js index d8569d5..414c8d8 100644 --- a/opsimate-docs/docusaurus.config.js +++ b/opsimate-docs/docusaurus.config.js @@ -33,6 +33,11 @@ module.exports = { }, blog: false, theme: { customCss: require.resolve('./src/css/custom.css') }, + sitemap: { + // /search is the Algolia results page -- it has no content of its + // own, and Google reports it as "Crawled - currently not indexed". + ignorePatterns: ['/search'], + }, // REMOVE gtag config here - we're using custom component instead }, ], diff --git a/opsimate-docs/src/pages/markdown-page.md b/opsimate-docs/src/pages/markdown-page.md deleted file mode 100644 index 9756c5b..0000000 --- a/opsimate-docs/src/pages/markdown-page.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: Markdown page example ---- - -# Markdown page example - -You don't need React to write simple standalone pages. diff --git a/opsimate-docs/vercel.json b/opsimate-docs/vercel.json index 06cce89..3efcf63 100644 --- a/opsimate-docs/vercel.json +++ b/opsimate-docs/vercel.json @@ -2,9 +2,6 @@ "buildCommand": "npm run build", "outputDirectory": "build", "framework": "docusaurus", - "rewrites": [ - { "source": "/(.*)", "destination": "/index.html" } - ], "headers": [ { "source": "/assets/(.*)",