fix: SEO — prevent Google from indexing /text instead of main page

- Add X-Robots-Tag: noindex, nofollow header to /text endpoint
- Add Link: canonical header pointing to HTML version
- Add Disallow: /text to robots.txt
- Update sitemap.xml lastmod to 2026-04-09
This commit is contained in:
juanatsap
2026-04-09 12:24:06 +01:00
parent 6e922fd1cb
commit 08b39653ba
3 changed files with 10 additions and 4 deletions
+2
View File
@@ -152,6 +152,8 @@ func (h *CVHandler) PlainText(w http.ResponseWriter, r *http.Request) {
// Set response headers
w.Header().Set(c.HeaderContentType, c.ContentTypePlainText)
w.Header().Set(c.HeaderXContentTypeOpts, c.NoSniff)
w.Header().Set("X-Robots-Tag", "noindex, nofollow")
w.Header().Set("Link", `<https://juan.andres.morenorub.io/?lang=`+langCode+`>; rel="canonical"`)
// Check if download is requested
if r.URL.Query().Get("download") == "true" {