Aizii Learn · AI Search
← Back to Learn

How to add llms.txt to a custom website

A custom website means hand-built code with no platform rules in the way: you already have file access, and the file belongs wherever your stack puts static files, next to robots.txt. The constraint is not permission but conventions: where your build puts public assets is where llms.txt goes, and that place is different in every framework.

Why a custom website is different

Unlike a hosted platform, nobody can give you one path. The decision tree is your stack. On a static setup (Astro, Eleventy, plain HTML) you drop the file in the published root. On Next.js it goes in public/llms.txt and ships on the next deploy with no route to wire up. On Vercel, Netlify, and GitHub Pages the public folder is served as-is. The alternative on any framework is a route handler that returns the text with a text/plain content type; that route is worth building only if your file needs to change with your content (pulling from the same CMS index as the rest of the site).

The file you are publishing

The full format lives in our llms.txt guide. This is the file itself, from a sample outdoor gear store:

# Cedar and Pine Outfitters
> Cedar and Pine Outfitters sells outdoor apparel and camping gear from its Seattle storefront, shipping across the US. Runs an in-house tent repair service and publishes beginner backpacking guides.
## Shop
- [Tents](https://[yourdomain.com]/collections/tents): Two-person and family tents, described by season rating and packed weight.
- [Sleeping bags](https://[yourdomain.com]/collections/sleeping-bags): Down and synthetic bags, described by temperature rating.
- [Backpacks](https://[yourdomain.com]/collections/backpacks): Day packs and multi-day packs, listed with capacity in liters.
## Guides
- [Backpacking checklist](https://[yourdomain.com]/pages/backpacking-checklist): Complete gear list for a first overnight trip.
- [Tent care and repair](https://[yourdomain.com]/pages/tent-repair): How the in-house repair service works, turnaround and pricing.
## Policies
- [Shipping and returns](https://[yourdomain.com]/pages/shipping-returns): Free shipping over 75 dollars. 60-day returns on unused gear.
## Optional
- [Journal](https://[yourdomain.com]/blogs/journal): Trip reports and gear maintenance notes.

Steps

  1. Check first. Open [yourdomain.com]/llms.txt in a browser, replacing yourdomain.com with your actual domain. If your site is brand new, expect a 404.
  1. Find where static files land. Look at where your robots.txt is served from in your project; llms.txt goes in the same place. On most frameworks that is a public/ or static/ directory, or the output folder of your static build.
  1. Add the file. Write your Markdown (what goes in it is covered in our llms.txt guide), name it exactly llms.txt in all lowercase, and commit it with the rest of the project so it survives deploys. If you take the route-handler path instead, return it with a text/plain; charset=utf-8 content type.
  1. Deploy and verify. Open [yourdomain.com]/llms.txt and confirm a 200 status and plain text. Check the headers with curl -I https://[yourdomain.com]/llms.txt and confirm the 200 and the text/plain content type. If your host serves .txt files with the wrong content type or forces a download, that is a host configuration setting to fix, not a file problem.

The fundamentals

  • •What goes in the file: your name, one-paragraph summary, and curated links with one-line descriptions, see our llms.txt guide
  • •Crawler permissions live in robots.txt, never in llms.txt, see our robots.txt guide
  • •The structured data behind the pages you link, see our product schema guide

A hypothetical example

Say you built your store on Next.js and deploy to Vercel. You drop llms.txt into public/, push, and the file is live at your domain on the next deploy. A month later you move your guides from /guides/ to /learn/. Your old Markdown file still links to the old paths. The scan flags the broken links. You update the file and push; it is live again with the same deploy. That is the custom-site maintenance contract: the file rides your normal deploy process, which is convenient right up until you forget it is part of it.

What this guide does not cover

Generating the file dynamically from your CMS (a developer task, worth it once the catalog outgrows a hand-maintained list). Server-level logging and crawler monitoring. The transaction layer.

Frequently Asked Questions

Where should llms.txt be placed in Next.js or Astro projects?
Place the file directly in the public/ folder. Static site frameworks automatically serve everything in public at the root domain.
Do I need to rebuild the project when I update llms.txt?
Yes. On static platforms like Vercel or Netlify, static assets are deployed during the build process, so pushing a commit triggers the update.
Can I generate llms.txt dynamically from my database during build time?
Yes. A simple build script can query your database for categories and export the formatted markdown file directly into public/llms.txt.

Check your own brand now

Run the free scan at aizii.ai/aeo-scan. One click, no signup, and it shows how readable your site is to AI tools today.

Run the free scan