-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Handle /page/ redirects for subprojects #12627
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
base: main
Are you sure you want to change the base?
Handle /page/ redirects for subprojects #12627
Conversation
Documentation build overview
Show files changed (6 files in total): 📝 6 modified | ➕ 0 added | ➖ 0 deleted
|
Documentation build overview
Show files changed (20 files in total): 📝 17 modified | ➕ 0 added | ➖ 3 deleted
|
| def test_page_redirect_on_subproject_alias(self): | ||
| r = self.client.get( | ||
| "/projects/this-is-an-alias/page/test.html", | ||
| headers={"host": "project.dev.readthedocs.io"}, | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably add a test case for a project with a custom /projects/ prefix in the URL as well.
|
Not really sure what type of problem this is solving? Using the parent project with /projects//page/? Not really sure if we should support that, the parent project isn't a subproject of itself, we don't have those types of URLs anywhere. I'm also not sure if we should support looking by slug, all doc URLs use the alias. |
|
@stsewd This was requested by a user: https://app.frontapp.com/open/msg_1ywmnguf?key=jm1YcL6gOAX1QmsaqmZTk3mxMvR2geLL Also I want it for our docs, for example https://docs.readthedocs.com/platform/page/reference/git-integration.html |
|
We already support page redirects for subprojects, the URL should be https://docs.readthedocs.com/projects/platform/page/reference/git-integration.html. What is not supported is using a custom prefix. |
|
Huh... ok 🤔 |
|
I will close this then, and let the user know. |
Summary
/projects/<subproject>/page/redirectsTesting
DJANGO_SETTINGS_MODULE=readthedocs.settings.proxito.test uv run pytest readthedocs/proxito/tests/test_old_redirects.py::InternalRedirectTests::test_page_redirect_on_subproject -vv -suv run ruff check readthedocs/proxito/views/serve.py readthedocs/proxito/tests/test_old_redirects.pyCodex Task