-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
can't use /en/
or /zh/
as path prefix with single version
#8399
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 is a current limitation from our code that serves the documentation, since we try to map the URL to the correct version/translation/subproject instead of using the project information to map that URL to a correct file. I put some comments on an alternative implementation for our serve code that could fix this kind of problems #8327 |
Our new implementation of the code that serves documentation doesn't have this problem, the new implementation is under a feature flag, but we won't be able to support this case till we make remove the old implementation, specifically this readthedocs.org/readthedocs/proxito/urls.py Lines 163 to 171 in eadf6ac
|
This will work once we remove this https://github.com/readthedocs/readthedocs.org/blob/eadf6ac6dc6abc760a91e1cb147cc3c5f37d1ea8/readthedocs/proxito/urls.py#L163-L171 and make the new implementation the default. Closes #8399
Mostly removing old code, there is only one small custom addition https://github.com/readthedocs/readthedocs.org/blob/6595bdac198b482e1279c0e3b1925198f6baa631/readthedocs/proxito/views/serve.py#L144-L146 Django doesn't capture the first slash, previously we were getting the path from request.path_info, that includes the slash! When a request is done to `/` the path is set to "" (empty), our code relies on that being `/`. - Closes #10408 - Closes #8399 ### How to deploy this change - Deploy everything as usual, but don't run the `projects 0105` migration!!! - After deploy is done, run the `projects 0105` migration
Details
( I replace the
en
with_en
in the latest build, but older build are broken)Expected Result
URL like
domain/en/introduction.html
should works fine.Actual Result
all URL like
/en/introduction.html
or/zh/introduction.html
prefix get 404but url
/en/extra/index.md
works fine.The text was updated successfully, but these errors were encountered: