Dynamic Clean URL shows a 404 error on Reload #11178
Replies: 3 comments 10 replies
-
@Xtremilicious have you made this work on Netlify? |
Beta Was this translation helpful? Give feedback.
-
How did you configure it to render (instead of 404) new pages on browser reload, that were created post-deploy? |
Beta Was this translation helpful? Give feedback.
-
For those who are still looking for a solution. By default, Netlify and some other static site generator looks for the static HTML file based on request. The flow looks like this:
But it won't be found since it does not exists and that dynamic page is generated as their actual file name. [id].js to [id].html Solutions:exportPathMapTo generate the static HTML files ahead of time via the deployment build process. RewritesWhat this will do is instead of server looking for /users/1000.html it would rewrite to /users/[id].html. At Netlify you can configure this behavior via netlify.toml file. |
Beta Was this translation helpful? Give feedback.
-
As the title says, the dynamic URL works when redirected after a click, but when the dynamic page is reloaded, it shows a 404 error(after deployment on Netlify).
Tried deploying it on Zeit, and it works!
I guess I need to configure something for proper deployment in Netlify. Kindly help :)
The Clean URL defeinition:
The dynamic page:
Beta Was this translation helpful? Give feedback.
All reactions