question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dynamic Routes with suffix

See original GitHub issue

Feature 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:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
700softwarecommented, Jan 6, 2021

I’m using rewrites but it does complicate things. Dynamic Routes with prefix and/or suffix would be better.

1reaction
alekskorovincommented, Nov 17, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found