Dynamic Routes with suffix
See original GitHub issueFeature request
Dynamic Routes with suffix
Is your feature request related to a problem? Please describe.
Currently it is possible to have dynamic routes defined as:
pages/post/[pid].js
I am not able to define suffix for dynamic route.
Describe the solution you’d like
I would like to have possibility to put suffixes on two dynamic urls:
pages/post/[pid]-Suffix1.js
pages/post/[pid]-Suffix2.js
Describe alternatives you’ve considered
Alternative is dynamic imports but that limits me from being able to pregenerate all possible routes.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Dynamic page title with suffix word using routing data angular 5
setTitle(event['title'])); my routing file { path: '', component: HomeComponentComponent, pathMatch: 'full', data: { title: 'Home' } },. dynamic ...
Read more >Dynamic Routes - Next.js
Dynamic Routes are pages that allow you to add custom params to your URLs. Start creating Dynamic Routes and learn more here.
Read more >React Router Tutorial - 10 - Dynamic Routes - YouTube
React Router Tutorial - 10 - Dynamic Routes · Key moments. View all · Key moments · Description · Key moments. View all...
Read more >Is is possible to set proxy path suffix dynamically
Hello ApiGeeks, I got a scenario to which i want to set proxy path-suffix dynamically,so that request must pass through conditional flow.Below is....
Read more >About Dynamic Routing - WatchGuard Technologies
With static routing, routing tables are set and do not change. If a router on the remote path fails, a packet cannot get...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I’m using
rewritesbut it does complicate things. Dynamic Routes with prefix and/or suffix would be better.Let me show some working approaches for routes with suffixes. For example, you need some pages to be SSR, then you can create under the’pages an ssr folder where you could put the page [[…path]].js with getServerSideProps. Then you could use such rewrite in the next.config.js under
async rewrites() {:source: '/:path*/:key-ssr', destination: '/ssr/:path*/:key-ssr'that covers such URLs: /page-ssr /en/page1/page-ssr /en/page1/page2/page-ssr /en/page1/page2/page3/page-ssr etc.