Commit 37393b44 authored by Sandro Lutz's avatar Sandro Lutz Committed by Sandro Lutz
Browse files

Fix not found error page redirect

parent 115a3b2a
Pipeline #58400 passed with stages
in 10 minutes and 8 seconds
......@@ -44,7 +44,26 @@ const clientOnlyPaths = [
]
exports.onCreatePage = async ({ page, actions }) => {
const { createPage } = actions
const { createPage, deletePage } = actions
// Ensure that no automatic redirects are in place
// for the non-localized not-found page.
if (page.path === '/404') {
// Update the page
deletePage(page)
createPage({
...page,
matchPath: `/*`,
context: {
...page.context,
intl: {
...page.context.intl,
redirect: false,
},
},
})
return
}
clientOnlyPaths.forEach(path => {
const match = page.path.match(path.regex)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment