DEV Community

Purnima Shrestha
Purnima Shrestha

Posted on • Edited on

after deployment in live server, 404 error occurs on refresh of urls

-> i made an admin dashboard in React and built it for production
-> but after i build, the problem is that when I navigate to another page and hit refresh, an error occurs saying Cannot GET /login
-> after deployment in live server(using Filezilla), 404 error occurs on refresh of URLs

URL: https://demo.templatesjungle.com/admin/

I think the problem is this:
it's probably because i've built an SPA and haven't set up any redirects in your host
You'll need to redirect every route on your server back to / for an SPA to work.
what do I do? How do I do this?

app.js:
Image description

navigates.jsx:
Image description

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay