I'm facing the next situation, I'm using Next.js and I need to manage two different files that will use dynamic routes. The reason is that the site has static and SSR pages, the static ones use getStaticPath
and getStaticProps
functions and the SSR use getServerSideProps
. So Next doesn't allow to have those functions on the same file and that's why I can't have just one file that renders different page components or some logic to manage ssr or static.
Expected:
mysite.com/[...slug]
will be for static page
mysite.com/[...category]
will be for ssr page
All pages come from a wordpress CMS and their url structure cannot be changed. I mean the ssr url page from mini example above can't be mysite.com/etc/[...category]