Password or access control
用密码、VPN、Basic Auth 或平台访问控制保护 staging。
网站上线 QA
粘贴 staging、preview、QA 和 dev URL,生成多层防索引保护,避免非生产站出现在搜索结果里。
支持完整 URL、裸域名、预览域名和 localhost。
用密码、VPN、Basic Auth 或平台访问控制保护 staging。
只在 staging 提供 Disallow 全站的 robots.txt。
给 staging HTML 页面加 noindex,nofollow 作为第二层保护。
对 HTML 和文件响应发送 X-Robots-Tag: noindex, nofollow。
不要发布 staging sitemap,也不要提交到 Search Console。
仅在内容完全对应时,把 staging canonical 到生产 URL。
从分析、广告像素和转化看板中排除 staging 流量。
在发布清单里明确只有生产部署才移除防索引保护。
User-agent: * Disallow: / # Serve this robots.txt only on staging, preview, QA, and dev hosts.
<meta name="robots" content="noindex,nofollow,noarchive,nosnippet">
X-Robots-Tag: noindex, nofollow, noarchive, nosnippet
// vercel.json
{
"headers": [
{
"source": "/(.*)",
"headers": [
{ "key": "X-Robots-Tag", "value": "noindex, nofollow, noarchive, nosnippet" }
]
}
]
}# Staging 防索引检查清单
- 目标: 0
- 疑似 staging: 0
- 疑似生产域名: 0
- 必做检查: 8
- 配置片段: 4
## 目标
## 检查清单
- [ ] Password or access control: 用密码、VPN、Basic Auth 或平台访问控制保护 staging。
- [ ] Staging robots.txt: 只在 staging 提供 Disallow 全站的 robots.txt。
- [ ] Meta robots noindex: 给 staging HTML 页面加 noindex,nofollow 作为第二层保护。
- [ ] X-Robots-Tag header: 对 HTML 和文件响应发送 X-Robots-Tag: noindex, nofollow。
- [ ] Sitemap exclusion: 不要发布 staging sitemap,也不要提交到 Search Console。
- [ ] Production canonical: 仅在内容完全对应时,把 staging canonical 到生产 URL。
- [ ] Analytics exclusion: 从分析、广告像素和转化看板中排除 staging 流量。
- [ ] Production deploy gate: 在发布清单里明确只有生产部署才移除防索引保护。
## 配置片段
### robots
```
User-agent: *
Disallow: /
# Serve this robots.txt only on staging, preview, QA, and dev hosts.
```
### meta
```
<meta name="robots" content="noindex,nofollow,noarchive,nosnippet">
```
### header
```
X-Robots-Tag: noindex, nofollow, noarchive, nosnippet
```
### platform
```
// vercel.json
{
"headers": [
{
"source": "/(.*)",
"headers": [
{ "key": "X-Robots-Tag", "value": "noindex, nofollow, noarchive, nosnippet" }
]
}
]
}
```