How to implement robots.txt in nuxt.js

796 views Asked by At

I have looked at different documentation and it is still not clear to me if robots.txt is put in the root of the server or in the root of the code itself.

And I would like to know how it is implemented. I use nuxt.

1

There are 1 answers

0
Jimmar On

robots.txt should be served as a static file on the root of your app, it would depend on how your app is configured.
but you can also use the robots nuxt plugin https://nuxt.com/modules/robots which would also help you generate robots dynamically.
we use it to generate different robots files depending on the environment.