SwissDataScienceCenter / renku-ui

The web frontend of the Renku platform
https://renkulab.io
Apache License 2.0
13 stars 6 forks source link

Return 404 code on non-existing pages #1269

Open lorenzo-cavazzi opened 3 years ago

lorenzo-cavazzi commented 3 years ago

From @Panaetius

I just noticed in a test that going to e.g. https://renkulab.io/doesnt_exist.png shows a 404 page, but doesn't return a 404 error status code. I think this is a bad practice, and it's also discouraged by search engines, e.g. google https://developers.google.com/search/blog/2008/08/farewell-to-soft-404s / https://developers.google.com/search/docs/advanced/crawling/soft-404-errors

It should be easy to specify a response code with react-router.

lorenzo-cavazzi commented 3 years ago

Info: that is a bit harder than I thought since it requires server rendering (we can't send a 404 if we render on the client) https://reactrouter.com/web/guides/server-rendering

lorenzo-cavazzi commented 1 month ago

Should go into the (still missing) ShapeUp project "Server Side Rendering"