Skip to content

fix: add SPA _redirects fallback for Cloudflare Pages - #7

Closed
kiro-agent[bot] wants to merge 1 commit into
mainfrom
fix/deploy-readiness
Closed

kiro-agent[bot] wants to merge 1 commit into
mainfrom
fix/deploy-readiness

Conversation

@kiro-agent

@kiro-agent kiro-agent Bot commented Jul 26, 2026

Copy link
Copy Markdown

This pull request was created by @kiro-agent on behalf of @VZhou07 👻

Comment with /kiro fix to address specific feedback or /kiro all to address everything.
Learn about Kiro Web


Summary

Adds public/_redirects with a single-page-app fallback rule (/* /index.html 200).

The app uses BrowserRouter (client-side routing). Without this rule, a hard refresh or direct visit to a deep link (e.g. /classes/123) on a static host like Cloudflare Pages returns a 404, because no file exists at that path. The rule tells the host to serve index.html for any unmatched path so the client router can take over.

Testing

  • npm run build (tsc && refine build) succeeds.
  • Verified _redirects is copied into the build output at dist/_redirects (Vite copies public/).

Co-authored-by: Vincent <v23zhou@uwaterloo.ca>
@VZhou07 VZhou07 closed this Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants