Path failures on a website made in React.js

Hello, I have a problem regarding a website made in React.js, well, if you do not know through this you can manipulate the routes, for example when going to / contact, it will direct you to a page that I want, Well, when I want to write that in the URL of the browser, a 404 page appears.

Before I continue I invite you to go to my website, it is in Spanish but regardless of that you will understand my problem. Website.
And to be more explained, I have a section of a blog on the site, then go there, and you will see a blog and you will see that if you click this it sends you to a 404 page of netlify itself, because that did not happen in development.

Another thing is that by putting the React.js website on the table, it is hosted in Netlify, because if there it gives an invalid url with the domain a unique domain (that is, purchased), it sends you to an error page 404 BUT A PAGE THAT THE DEVELOPERS PLACED, not the one that comes by default in Netlify.

I wanted to know how to solve this, also if it only works with a personalized diminio, that is, purchased, so that it does so. In the most attentive way I ask you, please help me.

You need to set up a redirect and rewrite rule for your single page app:

/*    /index.html   200

You can add redirect rules to the _redirects file or to your netlify.toml config file.

ok, i’ll try, hmm but is that done in the build file?

I could try to explain everything in detail, but the docs do a far better job imho:

1 Like