1. Sitemap
要放哪裡、Content-Type 怎麼設
把檔案上傳到網站根目錄,讓 /llms.txt 打得開,並用 Content-Type: text/plain; charset=utf-8 回應。沒帶 charset,中文標題可能變亂碼;如果是任何路徑都回 HTML 外殼的單頁應用程式,送出去的就會是那個外殼,而不是你的檔案。
Cloudflare Pages 或 Workers 靜態資源:輸出資料夾裡的 _headers
/llms.txt
Content-Type: text/plain; charset=utf-8
Netlify:發布資料夾裡的 _headers
/llms.txt
Content-Type: text/plain; charset=utf-8
nginx:放在 server 區塊裡
location = /llms.txt {
types { text/plain txt; }
charset utf-8;
}
Vercel:專案根目錄的 vercel.json
{
"headers": [
{
"source": "/llms.txt",
"headers": [
{
"key": "Content-Type",
"value": "text/plain; charset=utf-8"
}
]
}
]
}
上線後拿首頁跑一次 AI 搜尋檢查,確認它被當成文字讀取。