Choorai

SPA Routing Basics

Understand why refresh can return 404 in React/Vue SPA and how fallback routing fixes it.

Core concepts

  • SPA: Single-page app where routing is handled in browser
  • Client-side routing: Router library controls path changes
  • Fallback: Server returns index.html for app routes

Why refresh gives 404

On refresh, browser requests current path from server directly. If server has no matching file, you get 404.

Fix direction

  • Add SPA fallback rule in hosting config
  • Separate static assets and app routes correctly

Practical troubleshooting

Last updated: February 22, 2026 · Version: v0.0.1

Send Feedback

Opens a new issue page with your message.

Open GitHub Issue