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" }
]
}
]
}
```