資源索引 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"
        }
      ]
    }
  ]
}
```