fix(web): stop robots.txt from blocking indexable pages (#610)

Remove Disallow for query-string URLs and /_next/, which caused Google
Search Console "Indexed, though blocked by robots.txt" for legitimate
pages discovered with UTM/tracking params. Canonical tags already handle
duplicate param URLs.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Jatin K Malik <jatinkrmalik@users.noreply.github.com>
This commit is contained in:
Jatin K Malik
2026-07-28 11:14:28 +05:30
committed by GitHub
co-authored by Cursor Agent Jatin K Malik
parent 4fad897f14
commit 63554bc323
2 changed files with 18 additions and 4 deletions
+5 -3
View File
@@ -1,13 +1,15 @@
# Robots.txt for Vocalinux
# https://vocalinux.com
#
# Intentionally permissive for marketing pages. Do not blanket-block
# query-string URLs or /_next/static — those caused Google Search Console
# "Indexed, though blocked by robots.txt" for otherwise valid pages.
# Duplicate/param URLs are handled via canonical tags instead.
User-agent: *
Allow: /
Disallow: /api/
Disallow: /_next/
Disallow: /out/
Disallow: /*?*
# Sitemap location
Sitemap: https://vocalinux.com/sitemap.xml
Host: vocalinux.com
+13 -1
View File
@@ -21,10 +21,22 @@ describe("SEO Assets", () => {
it("blocks crawler access to technical paths", () => {
expect(robotsContent).toContain("Disallow: /api/");
expect(robotsContent).toContain("Disallow: /_next/");
expect(robotsContent).toContain("Disallow: /out/");
});
it("does not block Next.js static assets needed for rendering", () => {
expect(robotsContent).not.toContain("Disallow: /_next/");
});
it("does not blanket-block query-string URLs", () => {
// Blocking all query strings causes GSC "Indexed, though blocked by robots.txt"
// for pages discovered with UTM/tracking params. Use canonicals instead.
const disallowRules = robotsContent
.split("\n")
.filter((line) => line.trimStart().startsWith("Disallow:"));
expect(disallowRules.some((line) => /\/\*\?\*/.test(line))).toBe(false);
});
it("includes core landing pages in sitemap", () => {
const expectedUrls = [
"https://vocalinux.com/",