Rewrite for Vite/react-router-dom not working

So when my app is deployed, if i refresh the page on a subpage e.g Condo Cube i get a 404. This does not happen locally.

So I followed the Create React App instructions for Rewriting on Render even though my app is built with Vite and added the following rule to my static site:

Source Path /*`
Destination Path /index.html
Action Rewrite

However when I try refreshing /contact it gives me the following URL /index.html which is not configured in my react-router-dom and throws a 404. My Routes are setup so that “/” is the index page. If I change the Destination Path in the rule to “/” then it redirects me to the index page, but not the /contact page. Am I missing something here?

So the first link is /contact

All other links are preceded by www.condo-cube.com but I had to trip them due to the 2 link rule for new users

Ok so I accidentally had it on Redirect and now I put it on Rewrite :stuck_out_tongue:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.