Home
Support Forums

Routing a dynamic page

I’m working on a side project but I couldn’t reach a dynamic route when I click a link like this:

https://themarket-place.netlify.app/contact/:token

Webpage url:
https://themarket-place.netlify.app/

Can anyone help on this forum?

Hi @OdofinG,

How do you plan on rendering that page? Are you using Server Side Rendering?

No, I hosted Frontend (react) on netlify and backend on heroku I thought I could hit a dynamic route with netlify

I don’t think there can be any automatic configuration in this case. You can use serverless functions to render content dynamically, but the exact route you’re trying won’t work.

In short, you can try to send all pages from /contact/* to a serverless function and probably setup a middleware there, or not - depending on the path you wish to choose. In that function, you would have to write up logic to generate a HTML page on the fly and send it back to the client side.

Can you teach me how to do that using serverless function?

Also, how can I customize my error 404 page?

Example here: GitHub - philhawksworth/virtual-lolly: JAMstack demo site - prerendered with serverless API fallbacks

Docs here:Redirect options | Netlify Docs

Did you get any help by yourself? I am also stuck there my client demand that type of thing but i didn’t know how i do this.

I’ve shared the required resources and approach above. Did you take a loom at that?