Pages Returning Homepage HTML instead of proper resources

What is the name of the domain?

What is the issue you’re encountering

When every I open an invalid URL in my website, like: ORV-Reader then Cloudflare returns the Homepage HTML and the same goes for Robots.txt and Sitemap.xml when seen from google search console, so google and other bots cant even index the site, I am new to this so idk how things work, this is my _headers file, /meta/.json Cache-Control: public, max-age=21600 /assets/ Cache-Control: public, max-age=21600

Screenshot of the error

The return of the hompage is expected behavior for pages unless you’ve defined a 404 page.

Serving Pages · Cloudflare Pages docs. If you want/need a robots.txt file or sitemap.xml I believe you’d need to define those in your project as well.

2 Likes

how can i define robot.txt and sitemap.xml?

is it done use _redirects?

You would create those files in the root of your project where the index page is and populate with whatever data you wanted

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.