资源索引 Header
X-Robots-Tag Header 规划器
选择资源规则,上线前生成适用于 Nginx、Apache、Netlify 和 Vercel 的 X-Robots-Tag 配置。
就绪100/100
严重0
警告0
就绪2
规则2
生成配置
location ~* \.(pdf)$ {
add_header X-Robots-Tag "noindex, nofollow, noarchive" always;
}
location ~* \.(jpg|png|webp)$ {
add_header X-Robots-Tag "noindex, noimageindex" always;
}报告预览
# X-Robots-Tag Header 方案
- 项目: 网站上线素材
- Bot 目标: all
- 规则: 2
- 严重: 0
- 警告: 0
- 就绪: 2
## Nginx
```nginx
location ~* \.(pdf)$ {
add_header X-Robots-Tag "noindex, nofollow, noarchive" always;
}
location ~* \.(jpg|png|webp)$ {
add_header X-Robots-Tag "noindex, noimageindex" always;
}
```
## Apache
```apache
# Requires mod_headers
<FilesMatch "\.(pdf)$">
Header set X-Robots-Tag "noindex, nofollow, noarchive"
</FilesMatch>
<FilesMatch "\.(jpg|png|webp)$">
Header set X-Robots-Tag "noindex, noimageindex"
</FilesMatch>
```
## Netlify
```text
/downloads/*.pdf
X-Robots-Tag: noindex, nofollow, noarchive
/assets/originals/*
X-Robots-Tag: noindex, noimageindex
```
## Vercel
```json
{
"headers": [
{
"source": "/downloads/(.*).pdf",
"headers": [
{
"key": "X-Robots-Tag",
"value": "noindex, nofollow, noarchive"
}
]
},
{
"source": "/assets/originals/(.*)",
"headers": [
{
"key": "X-Robots-Tag",
"value": "noindex, noimageindex"
}
]
}
]
}
```