fix(admin): 后台校验文件避免 301,并让搜索引擎读到 noindex

serve -s 会把 .html 301 去后缀,百度站长验证失败;同时放开 robots 抓取,避免旧标题一直留在 SERP。
This commit is contained in:
2026-09-01 09:11:43 +08:00
parent f35e1a3ba5
commit eeee55e215
12 changed files with 42 additions and 23 deletions
+6 -5
View File
@@ -1,11 +1,12 @@
# 禁止搜索引擎抓取shop / partner / admin,含测试域)
# 合规爬虫读 robots.txtX-Robots-Tag 覆盖不先读 robots.txt 的抓取器
# 禁止搜索引擎收录shop / partner / admin,含测试域)
# 必须允许抓取页面:Disallow:/ 会让百度无法读到 noindex,旧标题会一直留在 SERP。
# X-Robots-Tag 覆盖不先读 robots.txt / 不执行 JS 的抓取器。
add_header X-Robots-Tag "noindex, nofollow, noarchive" always;
add_header X-Robots-Tag "noindex, nofollow, noarchive, nosnippet" always;
location = /robots.txt {
default_type text/plain;
charset utf-8;
add_header X-Robots-Tag "noindex, nofollow, noarchive" always;
return 200 "User-agent: *\nDisallow: /\n";
add_header X-Robots-Tag "noindex, nofollow, noarchive, nosnippet" always;
return 200 "User-agent: *\nAllow: /\n";
}