readthedocs / website

The Read the Docs community website
15 stars 5 forks source link

Hack to use 404 error page in RTD #220

Closed agjohnson closed 10 months ago

agjohnson commented 10 months ago

I opened https://github.com/readthedocs/readthedocs.org/issues/10622 to consider making this configurable. The other error status codes are not supported by RTD yet.


:books: Documentation preview :books:: https://read-the-docs-website--220.com.readthedocs.build/

agjohnson commented 10 months ago

Example 404 page at: https://read-the-docs-website--220.com.readthedocs.build/foo

I'd like to update that one a little bit, it was meant more as an application error page. But it works at least and you don't get the RTD search page.

ericholscher commented 10 months ago

I see we're actually outputting these files, which we probably don't want to do? eg. https://about.readthedocs.com/errors/401/

But I guess RTD needs a top-level 404 files, so not really avoidable at least for the 404 page 😆

agjohnson commented 10 months ago

I see we're actually outputting these files, which we probably don't want to do?

This was indeed intentional, but if there is a good reason not to we don't have to. We don't really have another option though, yeah. Maybe this is all a good discussion for an improved version of the error response overrides on RTD.

Ideally, I'd love to configure RTD to know about all of these templates, configure them at a nested path, and not serve them through regular requests like /errors/404/. I'd also like to configure other 4xx and 5xx responses too.

I noted some of this in: