Closed rinseringma closed 4 years ago
currently the _redirects file can not be generated dynamically with this module. However, Netlify allows to configure redirects also via netlify.toml, which you can generate with this module like this:
// nuxt.config.js
export default {
buildModules: [
'@nuxtjs/netlify-files'
],
netlifyFiles: {
netlifyToml: {
redirects: [
{
from: '/old',
to: '/new',
status: 302
}
]
},
// if no other netlify files are needed, you can set this to false
// copyExistingFiles: false
}
}
Published the recent version now as well 👍🏻 So programmatic creation is available now ☺️
I've read the documentation on the github page, but I can't figure out how to use this module to create an _redirect file for Netlify.
What I want is that it would generate that file and write it to the static folder. Redirects must be pulled from an custom API endpoint containing the old url, new url and a statuscode. So that the marketeers can adjust the redirects in the backend according to their needs.
Could someone help me setting this up? Thanks!