Static sites and routing

I am trying to create a static site that uses react-router-dom to handle routing. If the visitor goes to the top level of the site (e.g. foo.kinsta.page/), the site works as expected. But if the visitor tries going directly to any route (e.g. foo.kinsta.page/about), the site returns a 404 Page Not Found error message.

Is there support for an .htaccess file, or a 404.html or 200.html file, that can properly intercept these attempts to access routes directly?

Hi @Jeffrey_Pinyan :wave:

If you’ve used npm/node to create.a react application, this might help:

Thinking maybe /about isn’t in your Routes list?

.htaccess isn’t supported like typical Apache or NGINX, because the routing would be based on nodejs/npm and your react app. So essentially you’d be making your known routes explicit, and setting the element on path="*" to {<NotFound />} or whatever you name the .js file with the react-router-dom export default function serving your 404 page, as per the above article.

Best regards,
Zach