-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
404 page broken when served for URL paths with /
s in them
#3930
Comments
Another possible solution (via @jonasfj):
|
@athomas I think this is specific to Since the GCS serving setup for |
The single file that handles all 404s is currently part of the dartdoc output, though. |
Yeah, but your bucket contains output from any different versions of And the layout of your bucket is something you've decided. You could just make an HTML file as follows: <meta http-equiv="refresh" content="0; url=https://api.dart.dev/__404error.html">
<h1>404 - Not Found</h1> The downside is that now I can't really fix the typo I made. Because the URL I mistyped has disappeared from the address bar. |
The problem occurs regardless of that, because even if you host dartdoc from the root of your site, the 404 page will still be broken depending on how many slashes the 404 URL has. That being said, my specific problem can be solved with a solution specific to api.dart.dev. |
The 404 page can't load files that it depends on when it's not served at the same path as
static-assets/
(the path contains a slash after the root of the page).Example:
https://api.dart.dev/dart-core/dart-cor2-library.html (wrong styling, broken links to other dartdoc pages)
https://api.dart.dev/wrong (works as expected)
Background:
The load balancer of api.dart.dev (or currently the GCS bucket) serve the 404 page as part of the 404 response of the given URL (no redirect). However, the page's implementation assumes it's served relative to its
static-assets/
(which is only available at the root).Possible solutions:
**/static-assets/**
and redirect them to the root (hackish as the page shouldn't depend on load balancer rules to work, would fix the styling but might need additional redirects to make the page fully functional).The text was updated successfully, but these errors were encountered: