SEO
robots.txt
What the robots.txt VitNode generates contains, which private paths it excludes in every language, and how to check it after a deployment.
With SEO set up, VitNode answers /robots.txt from config alone: no API call, no session and no database. It lets crawlers read the site, keeps them out of private areas and points them at the sitemap.
What the file contains
With seo: { indexing: true } on a site with English and Polish:
User-agent: *
Allow: /
Disallow: /admin
Disallow: /settings
Disallow: /pl/settings
Disallow: /modcp
Disallow: /pl/modcp
Disallow: /files
Disallow: /pl/files
Disallow: /login
Disallow: /pl/login
Disallow: /register
Disallow: /pl/register
Sitemap: https://example.com/sitemap.xmlAllow: /opens everything that is not excluded below it.- The
Sitemap:line appears only while the sitemap is published. Withindexing: falseit is gone and the rules stay. HEAD /robots.txtreturns the same headers with no body.
Excluded paths
| Path | Why |
|---|---|
/admin | The AdminCP. Never locale-prefixed. |
/settings | A member's account settings. Needs sign-in. |
/modcp | The moderator control panel. Needs sign-in. |
/files | A member's uploaded files. Needs sign-in. |
/login | Sign-in, plus password reset, email verification and SSO callbacks, whose links carry one-time tokens |
/register | Registration. Nothing to index. |
Every path except /admin is excluded in each language's URL, including translated route paths: with routePaths: { pl: { '/settings': '/ustawienia' } } the Polish line is Disallow: /pl/ustawienia. With a domain per language, each domain's file lists only the languages that domain serves.
Rules match by prefix, as robots.txt always does, so Disallow: /files also covers /files/2. Those pages are still protected by their own sign-in checks; the rules only stop well-behaved crawlers from asking.
The list is fixed. To keep one of your own pages out of search results, don't block it here. Give it robots: 'noindex, follow' in its page metadata instead: a crawler must be able to fetch a page to see its noindex.
Check the result
After a deployment, fetch the live file:
curl -i https://example.com/robots.txtExpect 200, content-type: text/plain; charset=utf-8, the rules above and exactly one Sitemap: line with your origin.
Cloudflare's managed robots.txt feature (in the zone's AI crawler and bot
settings) prepends Cloudflare's own rules to the file visitors receive. If it
is on, curl your live /robots.txt after deploying and turn the setting off
when its rules conflict with seo.crawlers.
Static files in public/ are also served before the Worker runs, so remove
any old public/robots.txt.
Related
- AI crawlers: separate rules for search and training bots.
- Indexing: keep a preview deployment out of search results.