How to make robots + sitemap available?
Folks, any idea or anyone of you who managed to make these available w/o 404 error?
Steps attempted to make robots.txt and sitemap.xml accessible:
Generated via Lovable prompt
Used “Create a sitemap with my custom domain …”.
Result: sitemap was created internally but returned 404 externally.
Route-based approach
Added src/pages/robots.txt.ts and src/pages/sitemap.xml.ts to serve files server-side.
Result: still 404.
Public folder approach
Created public/robots.txt and public/sitemap.xml.
Result: still 404.
Added _redirects file
Rules to prevent SPA routing from swallowing /robots.txt and /sitemap.xml.
Result: after publishing, still 404.
Checked Vite config
Verified vite.config.ts → no custom publicDir set, so it should work.
Result: files still not served.
👉 Conclusion so far:
Both the route approach and the static public + redirects approach have failed.
Anyone of you with an idea pls 🤓?
2
3 comments
Michael Gründling
4
How to make robots + sitemap available?
Vibe Coding School
skool.com/lovable-vibe-coding
Currently: $30/mo. Vibe Coding School is the fastest path to your first client. Sign up & land client #1 in 90 days — guaranteed.
Leaderboard (30-day)
Powered by