Skip to content
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

Better 404 pages/redirection for static index meta-databases #76

Closed
ml-evs opened this issue Sep 15, 2021 · 6 comments
Closed

Better 404 pages/redirection for static index meta-databases #76

ml-evs opened this issue Sep 15, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@ml-evs
Copy link
Member

ml-evs commented Sep 15, 2021

It would be good to have a better default 404 template, such that when someone visits e.g. http://providers.optimade.org/index-metadbs/tcod, they get a link to the appropriate links endpoint. This has come up a few times in tutorials and other issues (#75, Materials-Consortia/providers-dashboard#60 and #74 (comment))

@ml-evs ml-evs added the enhancement New feature or request label Sep 15, 2021
@ml-evs ml-evs changed the title Better 404 pages for static index meta-databases Better 404 pages/redirection for static index meta-databases Sep 15, 2021
@ml-evs
Copy link
Member Author

ml-evs commented Sep 15, 2021

The other option would be to redirect all "raw" base URLs to the appropriate links endpoint.

@CasperWA
Copy link
Member

The other option would be to redirect all "raw" base URLs to the appropriate links endpoint.

I see you've already implemented this in #77, but I'm not sure this is the "correct" way to handle this. However, it is convenient. Personally, I'd prefer a web page response, as I may be a confused client going to the base URL and suddenly be redirected to a functional entry endpoint - it seems off, but it's very practical.

@ml-evs
Copy link
Member Author

ml-evs commented Sep 17, 2021

We can change my redirects to instead serve a custom 404 page (for just the providers base URLs), but what info should be on it? We can't use a templating engine or anything, so I don't think we can provide a link to the links endpoint, or serve any provider-specific data as we do in the OPT landing page (unless there are some HTML-only hacks for relative redirects/getting the current requested URL).

Other option of generating a 404 page per provider and committing in this repo seems like too large a burden to me.

@CasperWA
Copy link
Member

I would just add some hard-coded "common shortcomings/mistakes" list with a mention of "did you remember to add the major version and endpoint to the path?" or something?

@ml-evs
Copy link
Member Author

ml-evs commented Sep 17, 2021

Have updated my PR with something along these lines.

@ml-evs
Copy link
Member Author

ml-evs commented Sep 17, 2021

Closed by #77

@ml-evs ml-evs closed this as completed Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants