mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
This adds handling for repeated forward/back slashes in Next.js, when these slashes are detected in a request to Next.js we will automatically remove the additional slashes redirecting with a 308 status code which prevents duplicate content when being crawled by search engines. Fixes: https://github.com/vercel/next.js/issues/13011 Fixes: https://github.com/vercel/next.js/issues/23772 Closes: https://github.com/vercel/next.js/pull/15171 Closes: https://github.com/vercel/next.js/pull/25745
17 lines
319 B
JavaScript
17 lines
319 B
JavaScript
module.exports = {
|
|
redirects() {
|
|
return [
|
|
{
|
|
source: '/redirect-forward-slashes',
|
|
destination: '/test//google.com',
|
|
permanent: false,
|
|
},
|
|
{
|
|
source: '/redirect-back-slashes',
|
|
destination: '/test\\/google.com',
|
|
permanent: false,
|
|
},
|
|
]
|
|
},
|
|
}
|