Skip to content
Discussion options

You must be logged in to vote

I think the issue are the rewrite names, as per your previous discussion, you were rewriting to the same root, test, but if we change that:

import type { NextConfig } from "next";

const nextConfig: NextConfig = {
  /* config options here */
  async rewrites() {
    return [
      {
        source: '/:slug/:id(\\d{1,})',
        destination: '/test/:slug/:id'
      },
      {
        source: '/:section*', //for everything else
        destination: '/skip/:section*',
      },
    ]
  }
};

export default nextConfig;

With this tree within app:

src/app
├── layout.tsx
├── page.tsx
├── skip
│   └── [...rest]
│       └── page.tsx
└── test
    └── [slug]
        └── [id]
            └── page.tsx

T…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@icyJoseph
Comment options

@icyJoseph
Comment options

@icyJoseph
Comment options

Answer selected by lriggle-strib
@lriggle-strib
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants