What is GitHub Pages SPA 404 Helper?
GitHub Pages serves static files and does not know client-side routes unless a matching file exists. A single-page app can show 404 when a visitor opens a deep route directly. A 404 fallback can redirect the browser back to the app entry point while preserving the requested path for the router.
How to use this tool
- Enter the app base path. Use / for a user or custom domain site, or /repo-name/ for a project page.
- Choose whether the fallback should store the original path in the query string or hash.
- Copy the generated 404.html file into the published site root.
- Test a deep route directly after deployment.
What you can use it for
- Fix direct visits to client-side routes on GitHub Pages.
- Prepare a 404 fallback for React, Vue, Svelte, or vanilla routers.
- Document the base path needed for project pages.