Short Answer
Put your llms.txt file at the public site root: https://yourdomain.com/llms.txt. This is the most predictable, crawlable and discoverable location for AI agents and other tools that check for the file.
If your website is installed in a subfolder but served from the main domain, place the file where it loads from the main public URL, not necessarily where the application code lives.
Why the Site Root Is the Best Location
A root URL is easy to guess and easy to verify. A crawler, developer or AI agent can check /llms.txt without needing to search through your navigation. That matters because llms.txt is meant to be a simple convention, not a hidden configuration file.
Root placement also keeps the file close to related machine-readable files such as /robots.txt and /sitemap.xml. Each file has a different purpose, but they all benefit from predictable locations.
What to Do With an llms.txt File After Creating It
After creating the file, your job is to publish, test and maintain it. Many people stop after downloading the file, but the file only helps if it is publicly accessible and up to date.
- Download the file from the llms.txt generator.
- Validate it with the llms.txt Validator.
- Upload it to your public website root folder.
- Open
https://yourdomain.com/llms.txtin a browser. - Check that the file is not redirected to a login page, blocked by permissions or served as an error page.
- Update it when major documentation, product, API or support pages change.
Common Root Folders by Platform
The correct folder depends on your hosting setup. The goal is always the same: the file should load publicly at the root URL.
- Hostinger or cPanel static/PHP sites: usually
public_html. - WordPress: usually the folder containing
wp-config.php. - Laravel: often the
publicdirectory, not the project root. - Next.js, Astro or static hosting: the public/static folder or final build output folder.
- Subdomain sites: the root folder for that subdomain, so it loads at
https://docs.example.com/llms.txtif the subdomain is the target.
Should llms.txt Be Linked From Your Website?
It is not required, but it can be useful. You can link to /llms.txt from a developer page, documentation footer or AI policy page. This makes the file easier for people to inspect and may help crawlers discover it through normal internal links.
Do not hide important website information only inside llms.txt. The file should summarize and point to public resources, not replace normal pages that users and search engines need.
Common Mistakes to Avoid
- Uploading the file into the wrong private application folder.
- Naming it
llms.txt.txtby accident. - Publishing it at
/assets/llms.txtinstead of/llms.txt. - Blocking the file with server permissions or security rules.
- Creating the file once and never updating it after site changes.