-
Notifications
You must be signed in to change notification settings - Fork 34
Read the Docs ignores custom 404 at /404/index.html with dirhtml #215
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
Comments
Thanks for reporting this issue. It seems it's a bug in Read the Docs itself. We do have a check in place for I guess it's because it's not detected as HTMLDIR. I'll research a little and come back with the solution... Hopefully 😅 |
My guess was correct. Since you are using
I are not checking for that file always to avoid hitting S3 API and extra time for all the requests. However, I suppose we may need to re-consider this since we have support for more doctools now, and I don't think we can keep making the same assumption. @ericholscher what do you think? |
With the introduction of `build.commands` we cannot use `version.documentation_type` anymore since those versions will be `generic` and we can't skip checking for this file location. Note this commit may add and extra call to S3 API for all the 404 pages where our regular Maze will be shown. However, it removes 2 databsae calls from all the 404 requests. We could only add this extra check on S3 for `version.documentation_type='generic'`, but that would make the code a little more complex and we won't be removing these 2 db queries. Reference: readthedocs/sphinx-notfound-page#215 (comment)
@humitos Yea, agreed. We likely need to be smarter here, but I really dislike adding more checks for this. |
* Proxito: always check `404/index.hmtml` With the introduction of `build.commands` we cannot use `version.documentation_type` anymore since those versions will be `generic` and we can't skip checking for this file location. Note this commit may add and extra call to S3 API for all the 404 pages where our regular Maze will be shown. However, it removes 2 databsae calls from all the 404 requests. We could only add this extra check on S3 for `version.documentation_type='generic'`, but that would make the code a little more complex and we won't be removing these 2 db queries. Reference: readthedocs/sphinx-notfound-page#215 (comment) * Docs: mention `404/index.html` in hosting docs * Proxito: get the `Version` from inside `register_page_view` * Proxit: get the version after checking for bot score * Proxit: call `register_page_view` just once * Log: index file (`index.html` or `README.html`) I'm interested in `README.html` since we should probably deprecate that "feature" * Tests: add extra checks to make tests pass * Lint
This is already solved in readthedocs/readthedocs.org#9983 and it's going to be deploy today. Please, confirm this is working as you expected later today, or tomorrow 😄 |
Brilliant, thank you for the quick fix! |
Steps to reproduce
dirhtml
withnotfound_urls_prefix = "/"
for a single version site that is deployed at the root (i.e. no/en/latest/
)Actual result
Get the default maze:
Expected result
Get the custom 404 page.
More info
It seems that Read the Docs only supports a custom 404 page at
404.html
?https://docs.readthedocs.io/en/stable/hosting.html#custom-not-found-404-pages
And it looks like, with
dirhtml
, this extension builds the custom 404 page at404/index.html
, which Read the Docs ignores?For example, I can see custom 404 page (returning a 200) at:
https://cpython-devguide--1042.org.readthedocs.build/404/index.html
See also
python/devguide#1042
The text was updated successfully, but these errors were encountered: