Hello,
I made a React and Node application. The React was deployed by Netlify. I have my Node backend on Render. I can login, save data to the user, etc. But, when I try to go to, for example, “/user/games” by typing it in the address bar, it gives me a 404 page. But, when I try to go via a link in my application, I don’t have an issue. Here’s a link: https://63f53447a7f6a103901250e9–tubular-dodol-2bdb28.netlify.app/
Also, it might take a little time for your login to process if you register, but it will login. Thanks in advance.
It works because it proxies every request made to your site to the /index.html file, basically it returns the /index.html file no matter what URL you access the site via.
So instead of a request to /user/games trying to return a file from /user/games.html (or /user/games/index.html), the proxy causes it to return /index.html at which point the route (/user/games) is handled by your react application… which only exists on that single index.html page.
@kautif The general syntax for the _redirects file is explained here:
The /* is a wildcard which are often used with splats, they’re explained here:
The 200 is the HTTP Status Code, and some options are outlined here:
(You will also see that 301 is the default - so it’s what Netlify send when you don’t specify one):
They’re a fundamental of web responses so you can read about them elsewhere:
The overall combination used for Single Page Applications is explained here: