Unable to access sitemap.xml and robots.txt

I am using react js for my application.

{
    "rewrites": [
        {
            "source": "/robots.txt",
            "destination": "/robots.txt"
        },
        {
            "source": "/sitemap.xml",
            "destination": "/sitemap.xml"
        },
        {
            "source": "/(.*)",
            "destination": "/"
        }
    ]
}




It looks like the rewrites configuration for /robots.txt and /sitemap.xml don’t actually change the destination path, so they should be removed. Can you verify that those files/routes exist in the build output and deployed site?

This guide has some tips if you need help with that: Debugging 404 Errors

1 Like


Both my files are available in the vercel deployment

Thanks for sharing those details. Are you able to share the public repo or a minimal reproducible example? Even just sharing some info about how routing is handled in your React app would give us more insight.

I also recommend checking the runtime logs for more info about the error. That can give you more clues about why your app is displaying a custom 404 page even though the destination paths exist in your deployment output.