fix(404): add redirects for broken URLs and custom not-found page
Some checks failed
Build and Deploy / build (push) Has been cancelled
Some checks failed
Build and Deploy / build (push) Has been cancelled
- Add permanent redirects for /products/manoon to /products - Strip malformed /contact suffix from product URLs - Create custom branded 404 page with product navigation - Add NotFound translations for en and sr locales
This commit is contained in:
@@ -5,6 +5,32 @@ const withNextIntl = createNextIntlPlugin();
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
output: 'standalone',
|
||||
async redirects() {
|
||||
return [
|
||||
// Fix malformed URLs with /contact appended to product slugs
|
||||
{
|
||||
source: '/:locale(en|sr)/products/:slug*/contact',
|
||||
destination: '/:locale/products/:slug*',
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: '/products/:slug*/contact',
|
||||
destination: '/products/:slug*',
|
||||
permanent: true,
|
||||
},
|
||||
// Redirect old/removed product "manoon" to products listing
|
||||
{
|
||||
source: '/:locale(en|sr)/products/manoon',
|
||||
destination: '/:locale/products',
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: '/products/manoon',
|
||||
destination: '/products',
|
||||
permanent: true,
|
||||
},
|
||||
];
|
||||
},
|
||||
async rewrites() {
|
||||
const rybbitHost = process.env.NEXT_PUBLIC_RYBBIT_HOST || "https://rybbit.nodecrew.me";
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user