Allows ads.txt file to be added to app router root #71633
elisechant
started this conversation in
Ideas
Replies: 2 comments
-
You can just add the file in the |
Beta Was this translation helpful? Give feedback.
0 replies
-
Apologies for the run around, confirming that is correct. The confusion is the differing expectation between how robots.txt is handled by adding at apps/robots.txt vs adding ads.txt to public/ https://nextjs.org/docs/app/api-reference/file-conventions/metadata/robots It would be better if there was one way of doing things. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/dazzling-http-pdf5pv?file=%2Fapp%2Fads.txt%3A1%2C12
To Reproduce
Current vs. Expected behavior
Expected to see ads.txt rendered, however a 404 is shown.
Provide environment information
Which area(s) are affected? (Select all that apply)
Metadata
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local), Vercel (Deployed)
Additional context
An installation method of Google AdSense requires adding ads.txt to root of site, similarly to adding robots.txt, Next doesnot support this https://nextjs.org/docs/app/api-reference/file-conventions/metadata.
This can be worked around by adding the file at public and using a redirect in next.config:
Beta Was this translation helpful? Give feedback.
All reactions