New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@astrojs/cloudflare - Robot.txt not valid #72
Comments
@RodrigoTomeES thanks for the issue report. However this is not a issue with Astro or the Cloudflare adapter. AFAICT you don't have a |
@alexanderniebuhr Hi, thanks. I thought that astro sitemap add a Robots.txt 🤔, I will investigate it and add a 404 page. Sorry for the wrong issue |
Oh I'm unsure about I also advice again to check the output of the |
@alexanderniebuhr you are right, This is my _routes.json {
"version": 1,
"include": [
"/_image",
"/api/spotify"
],
"exclude": []
} How can I know if it is deployed as a SPA? I didn't touch any config of cloudflare plugin. Thanks for all! |
For those who have the same problem, I was able to solve it by adding a 404.astro component at the same level as index.astro. In the particular case of Cloudflare, if it does not detect a 404.index error page, it will infer that the website is a SPA and will redirect everything to index.astro (source). So even though /robots.txt existed, entering the path redirected me to /. Just add an error page and you're done! As of today, the official sitemap plugin does not add the robots.txt to /public, you must add it manually or follow these instructions: https://docs.astro.build/es/guides/integrations-guide/sitemap/#uso Thanks @alexanderniebuhr for share that link. |
Astro Info
Describe the Bug
PageSpeed said that Robot.txt is not valid
What's the expected result?
A valid Robot
Link to Minimal Reproducible Example
https://pagespeed.web.dev/analysis/https-rodrigotome-es/ee7rnvsq5l?form_factor=mobile
Participation
The text was updated successfully, but these errors were encountered: