fix: rewriting rules for my-pages

This commit is contained in:
Michael Zetterberg
2024-05-16 15:22:39 +02:00
parent f1682b5a15
commit 5e3041a73a
18 changed files with 150 additions and 282 deletions

View File

@@ -84,6 +84,11 @@ const nextConfig = {
destination: overview.de,
permanent: false,
},
{
source: myPages.en,
destination: overview.en,
permanent: false,
},
{
source: myPages.fi,
destination: overview.fi,
@@ -104,56 +109,32 @@ const nextConfig = {
rewrites() {
return {
beforeFiles: [
{
source: benefits.da,
destination: "/da/my-pages/benefits",
},
{
source: benefits.de,
destination: "/de/my-pages/benefits",
},
{
source: benefits.fi,
destination: "/fi/my-pages/benefits",
},
{
source: benefits.no,
destination: "/no/my-pages/benefits",
},
{
source: benefits.sv,
destination: "/sv/my-pages/benefits",
},
{ source: login.da, destination: "/da/login" },
{ source: login.de, destination: "/de/login" },
{ source: login.fi, destination: "/fi/login" },
{ source: login.no, destination: "/no/login" },
{ source: login.sv, destination: "/sv/login" },
{ source: overview.da, destination: "/da/my-pages/overview" },
{ source: overview.de, destination: "/de/my-pages/overview" },
{ source: overview.fi, destination: "/fi/my-pages/overview" },
{ source: overview.no, destination: "/no/my-pages/overview" },
{ source: overview.sv, destination: "/sv/my-pages/overview" },
{ source: profile.da, destination: "/da/my-pages/profile" },
{ source: profile.de, destination: "/de/my-pages/profile" },
{ source: profile.fi, destination: "/fi/my-pages/profile" },
{ source: profile.no, destination: "/no/my-pages/profile" },
{ source: profile.sv, destination: "/sv/my-pages/profile" },
{ source: profileEdit.da, destination: "/da/my-pages/profile/edit" },
{ source: profileEdit.de, destination: "/de/my-pages/profile/edit" },
{ source: profileEdit.fi, destination: "/fi/my-pages/profile/edit" },
{ source: profileEdit.no, destination: "/no/my-pages/profile/edit" },
{ source: profileEdit.sv, destination: "/sv/my-pages/profile/edit" },
{ source: stays.da, destination: "/da/my-pages/stays" },
{ source: stays.de, destination: "/de/my-pages/stays" },
{ source: stays.fi, destination: "/fi/my-pages/stays" },
{ source: stays.no, destination: "/no/my-pages/stays" },
{ source: stays.sv, destination: "/sv/my-pages/stays" },
{
source: `${myPages.da}/:path*`,
destination: `/da/my-pages/:path*`,
},
{
source: `${myPages.de}/:path*`,
destination: `/de/my-pages/:path*`,
},
{
source: `${myPages.fi}/:path*`,
destination: `/fi/my-pages/:path*`,
},
{
source: `${myPages.no}/:path*`,
destination: `/no/my-pages/:path*`,
},
{
source: `${myPages.sv}/:path*`,
destination: `/sv/my-pages/:path*`,
},
],
}
},