Rewrites is a rewrite, on the other hand, modifies how the server delivers content without the user's browser ever knowing.
Redirects is a redirect instructs the user's web browser to completely switch to a different URL.
To use rewrites use the rewrites key in next.config.js:
module.exports = {
async rewrites() {
return [
{
source: '/about',
destination: '/',
},
]
},
}
To use redirects you can use the redirects key in next.config.js:
module.exports = {
async redirects() {
return [
{
source: '/about',
destination: '/',
permanent: true,
},
]
},
}