webzod
account

Fix the syntax of robots.txt on Vercel

hygiene.robots.invalid · effort: minutes

Why it matters

A robots.txt that is really an html page, has rules before any User-agent line, or misspells a directive is partly or wholly ignored by crawlers. Rules you meant to apply then do nothing.

The fix

  1. Put the file in the public folder (public/robots.txt) so it is served as a static file. A rewrite that sends every path to index.html is the usual cause of an html answer.
  2. Redeploy and check https://example.com/robots.txt.

The examples use example.com. Replace it with your own domain.

Read the documentation (opens in a new tab)

Scan your domain to see whether this applies to you.