Fix state legislative tracker sharing links returning 404#911
Closed
Fix state legislative tracker sharing links returning 404#911
Conversation
Previously, only crawler/bot requests were proxied to Modal for the state legislative tracker routes. Regular user requests fell through and returned 404 because the app shell doesn't handle those routes. Now ALL requests to /us/state-legislative-tracker/* are proxied to Modal, allowing direct sharing links like: https://www.policyengine.org/us/state-legislative-tracker/ID/id-sb1450 Also preserves query strings in the proxy URL. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
SakshiKekre
added a commit
that referenced
this pull request
Apr 3, 2026
Add beforeFiles rewrites so tracker deep links like /us/state-legislative-tracker/MN/mn-hf4621 are served directly from Modal instead of through an iframe. The tracker's client-side router handles the path on page load. Previously, only /_tracker/* asset paths were rewritten. The tracker page itself was served via iframe through the [slug] route, which only matches a single path segment — deep links with state/bill sub-paths returned 404. Fixes #911
SakshiKekre
added a commit
that referenced
this pull request
Apr 6, 2026
Deep links like /us/state-legislative-tracker/MN/mn-hf4621 have been returning 404 because the iframe approach creates URLs the server can't resolve. The rewrite serves the tracker SPA directly from Modal so its client-side router handles any path natively. Known issues (to be fixed in a follow-up PR to the tracker repo): - Tracker has no PE header/footer (was provided by the iframe wrapper) - Favicon and logo SVGs use root-relative paths that 404 on our domain Fixes #911
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/us/state-legislative-tracker/*are proxied to Modal, allowing direct sharing linksBefore
https://www.policyengine.org/us/state-legislative-tracker/ID/id-sb1450→ 404 Page Not FoundAfter
https://www.policyengine.org/us/state-legislative-tracker/ID/id-sb1450→ Works correctlyTest plan
https://www.policyengine.org/us/state-legislative-trackerloads correctlyhttps://www.policyengine.org/us/state-legislative-tracker/ID/id-sb1450loads correctly🤖 Generated with Claude Code