-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Custom urlconf breaks automatic redirects #7136
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
I think this is because we're defaulting some of the variables when there's a urlconf. We probably just need to tighten up that logic: readthedocs.org/readthedocs/proxito/views/utils.py Lines 79 to 87 in f138d17
Something like: |
The new proxito implementation doesn't have this problem #10156. |
@stsewd awesome :) |
stsewd
added a commit
that referenced
this issue
Jun 7, 2023
The implementation was changed to a more limited feature, path prefixes, they are simpler, and can be exposed to users, since they are plain strings. Changes: - Renamed some variables to match our new standard names - The old implementation of this (urlconf) works together with the new implementation (current projects will continue to work). - The resolver and unresolver have been adapted to support the new path prefixes - `get_url_prefix` is meant to just get the prefix of the subproject, so it has been renamed to do just that. Tests are passing on .com :) There is also the question about what to do with the other views (the ones under`/_/`). Opened #10181 to talk about that, that feature can be implemented in another PR. And support for hiding the `language` component can also be implemented later #10307 Closes #7136
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using a custom urlconf, redirects like
/
->/en/latest
don't seem to work. Instead, a 404 error is returned. There is a similar issue where perhaps a top level request could redirect toen/latest
with the prepended prefix -- ie:/
to/subpath/foo/en/latest/
, though this is less important likely.To reproduce:
subpath/$language/$version/$filename
foo.readthedocs.io/subpath/en/latest/
-- this worksfoo.readthedocs.io/subpath/
-- 404 here, where normall we'd redirect tofoo.readthedocs.io/subpath/en/latest/
foo.readthedocs.io/
-- also 404 here, though this might be harder to resolveThe text was updated successfully, but these errors were encountered: