Next.js Discord

Discord Forum

Simple rewrite not working

Unanswered
onethread posted this in #help-forum
Open in Discord
The nextjs folder structure has /app/editorials/page.tsx
and /app/editorials/[uid]/page.tsx

I have this in the next.config.js:
{
      source: "/editorial/:path*",
      destination: "/editorials/:path*",
    },

This works for requests like /editorial/some-id
but /editorial always 404s.

I would think the :path* regex would handle /editorial, but even if I add an explicit
{
      source: "/editorial",
      destination: "/editorials",
   },

/editorial always 404s.

Any ideas?

0 Replies