@blogfreerecipe This is occurring because your site is a react based SPA (Single Page Application).
When you visit the site via the root /
it is automatically loading the index.html
which is your application, and then when you visit other pages you never actually leave the index.html
page (it just looks like you do).
So /recipeDetails/110133d3dd574821a9ab17b9d160d06d
loads in additional data and simulates a browser page change.
However when you make a fresh request for example by going to one of those sub pages directly or hitting refresh while on them (e.g. https://www.blogfreerecipe.com/recipeDetails/110133d3dd574821a9ab17b9d160d06d), the web server is being requested to serve that file… but the file doesn’t actually exist… hence the 404 error
.
The way around this is via redirects, you’ll want to have a _redirects
file in your deploy folder that contains:
/* /index.html 200
You can see it referenced in the documentation here: