On hard refresh on subpages, I get a 404 #1

Open
opened 2025-11-05 12:05:01 +00:00 by gosam · 0 comments
Member

Switching to HashRouter in src/main.tsx:3 keeps routing client-side even when the server can’t rewrite deep links, so CMD-clicked links now load correctly in new tabs. The only visible change is URLs now include # (e.g. /#/product). If you prefer clean URLs later, configure the server for SPA rewrites and swap back to BrowserRouter.

AI first said the production server should reconfigured but fixed it by adding # to the urls it looks like

e.g. https://www2.projectmycelium.com/#/cloud

I don't know if this is the right or best way to fix it but it should work for now

- Go to any subpage on staging, e.g. https://www2.projectmycelium.com/cloud - Hard-refresh, and you should get a 404 page - Emre said he has a fix for this: > Switching to HashRouter in src/main.tsx:3 keeps routing client-side even when the server can’t rewrite deep links, so CMD-clicked links now load correctly in new tabs. The only visible change is URLs now include # (e.g. /#/product). If you prefer clean URLs later, configure the server for SPA rewrites and swap back to BrowserRouter. > > AI first said the production server should reconfigured but fixed it by adding # to the urls it looks like > > e.g. https://www2.projectmycelium.com/#/cloud I don't know if this is the right or best way to fix it but it should work for now
sashaastiadi was assigned by gosam 2025-11-05 12:05:01 +00:00
Sign in to join this conversation.
No description provided.