From 33a3f997e629a972a1bbee04f322ecc5cb6ae4f4 Mon Sep 17 00:00:00 2001 From: ssbg04 Date: Thu, 22 Oct 2026 23:16:44 +0800 Subject: [PATCH] fix(seo): add HSTS headers, clean crawler directives, and exclude /links from sitemap --- .gitignore | 3 ++- astro.config.mjs | 1 + public/_headers | 5 +++++ public/robots.txt | 15 --------------- 4 files changed, 8 insertions(+), 16 deletions(-) create mode 100644 public/_headers diff --git a/.gitignore b/.gitignore index 26203f8..ab05fe7 100644 --- a/.gitignore +++ b/.gitignore @@ -26,7 +26,7 @@ Sanity-studio/ # production /build - +.agents/ # misc .DS_Store *.pem @@ -56,3 +56,4 @@ next-env.d.ts # astro **/.astro/ dist/ + diff --git a/astro.config.mjs b/astro.config.mjs index 8230780..b4e4d1e 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -24,6 +24,7 @@ export default defineConfig({ !page.includes('/maintenance') && !page.includes('/chat') && !page.includes('/gallery') && + !page.includes('/links') && !page.includes('/_image'), serialize(item) { if (item.url === 'https://crischarles.com' || item.url === 'https://crischarles.com/') { diff --git a/public/_headers b/public/_headers new file mode 100644 index 0000000..9968390 --- /dev/null +++ b/public/_headers @@ -0,0 +1,5 @@ +/* + Strict-Transport-Security: max-age=31536000; includeSubDomains; preload + X-Content-Type-Options: nosniff + X-Frame-Options: SAMEORIGIN + Referrer-Policy: strict-origin-when-cross-origin diff --git a/public/robots.txt b/public/robots.txt index 8d125d0..7eb3f4e 100644 --- a/public/robots.txt +++ b/public/robots.txt @@ -14,20 +14,5 @@ User-agent: Googlebot-Image Disallow: /gallery Disallow: /gallery/ -# Allow specific crawlers -User-agent: Googlebot -Allow: / -Disallow: /api/ -Disallow: /.vercel/ -Disallow: /.astro/ -Disallow: /maintenance -Disallow: /gallery -Disallow: /gallery/ - -User-agent: Bingbot -Allow: / -Disallow: /gallery -Disallow: /gallery/ - # Reference to sitemap Sitemap: https://crischarles.com/sitemap-index.xml