My route is something like below
/live/[:id]
Example:
/live/1234234
/live/333333
/live/23546757
This route keeps on changing based on some id
Now, locally this works, but when pushed into deployment on render. I get error 404 not found.
How do I implement this dynamic routing.
I am using static site and trying to render dynamic pages using React router.
Here is the folder structure: chesslive365/src at main · AshishGusain17/chesslive365 · GitHub
My main file is index.js and from there App.js is called.
Do you want me to convert all the routes into index.html and use rewrite to make that work?
If you’re using a Static Site, I suspect your build command is already generating the index.html for you. You shouldn’t need to change your code. It should just require adding the rewrite rule on the Static Site, as covered in the React guide shared above.
So I added index.html in rewrite but still all the links shows 404 not found
Here, is the deployed website: https://chesslive365.onrender.com. Home page opens up correctly. Now if you click on challenge a friend link and refresh the page the url redirects the link as below: