I have a lot of reference to my site I'm migrating to NextJS that start with capital letters like this:
https://svcc.mobi/Presenter/2019/llewellyn-falco-3133 (notice the capital P in Presenter)
I want them all to rewrite to
https://svcc.mobi/presenter/2019/llewellyn-falco-3133
I can update my next.config.js
as below to take care of this for a single entry, but I want to have a few thousand of these entries in my next.config.js
file. Can I somehow load this array programmatically at build time? (like getStaticPaths kind of).
module.exports = {
async rewrites() {
return [
{
source: '/(P|p)resenter/2019/llewellyn-falco-3133',
destination: '/presenter/2019/llewellyn-falco-3133',
},
{
source: '/(a|A)(b|B)(o|O)(u|U)(t|T)',
destination: '/about',
},
{
source: '/(s|S)ession',
destination: '/session',
},
{
source: '/(p|P)resenter',
destination: '/presenter',
},
];
},
images: {
domains: ['ddrt7tzfkdwdf.cloudfront.net', 'www.siliconvalley-codecamp.com'],
},