-
-
Notifications
You must be signed in to change notification settings - Fork 77
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 on API docs path should not redirect out of context #118
Comments
The server is redirecting visitors to the generic https://crystal-lang.org/404 because the rules are set that way - that's a mistake we have to fix. The thing is - we don't have an API docs' 404 page. I guess we should make the There's a chance that thing doesn't work, because we're currently (ab)using some redirect rules that involve redirecting 404 errors to support the Do you know of an "easy" way of adding an extra, totally arbitrary page to the ones generated by |
I suppose we should probably generate an error page with the docs generator. That would mean everyone using |
I've created a basic 404 page at crystal-lang/crystal#11428 |
We've been taking a look at this, and the issue is a bit tricky. The Then there's a whole bunch of redirection rules spread between the CloudFront Origins config, each S3 bucket's "static website configuration", and even some redirection properties set on specific S3 files - all of which, combined, kind of make the whole redirection system work so that visiting Those redirections are all based on the original request returning a 404 error - ie, there's no Using redirections, I guess we won't be able to achieve a much better result than this. But there's probably a lot of room for improvments. |
The fact that this routing configuration is spread across three different management systems is very ungood. With crystal-book it's actually four, because there are also internal redirects of legacy paths (https://github.com/crystal-lang/crystal-book/blob/b2665283af1a6c9dedf4d415b1be31767ae53394/mkdocs.yml#L46). These are implemented via HTML redirects (via http-equiv/JavaScript) and are probably fine as they are tightly related to the content. As far as I understand, we would need to restrict the redirect from |
I'd start by writing a "test suite" that specifies where a visitor should end up when they visit the different relevant URLs, and try to cover every case out there. That will help us choose how to achieve that. We may find it easier to generate the redirects on the static site generator, maybe, on a file-by-file basis, instead of having those rewrite rules spread all over the place. Or maybe not - thinking of all the different cases at the same time will help us choose. |
When you request a non-existing path in the API browser (for example https://crystal-lang.org/api/master/Flate.html), you're redirected to https://crystal-lang.org/404.
There are two problems with this:
Ideally, https://crystal-lang.org/api/master/Flate.html should show a 404 page in the API browser design with the sidebar and state that the page was not found and maybe this feature was removed and documentation can be found in an older version. This would also allow to change the version selector in the sidebar to take you directly to a different version of a page instead of the readme which is currently the case.
Solutions might be out of scope for this repo, but I suppose this is probably the best place to discuss this.
The text was updated successfully, but these errors were encountered: