Skip to content

robots.txt missing in /public (Astro)

Astro serves static assets from the /public directory. Without a public/robots.txt, no /robots.txt is served at all. Crawlers operate without guidance and may index paths you did not intend to be public.

Create public/robots.txt.

User-agent: *
Allow: /
Sitemap: https://example.com/sitemap-index.xml

Replace https://example.com with your actual domain. If you use @astrojs/sitemap, the sitemap lands at /sitemap-index.xml by default. If you are using a hand-written public/sitemap.xml, change that line to match.

Terminal window
curl -I https://yourdomain.com/robots.txt

Confirm the response is 200 OK. Then re-run orino audit.