Skip to content

Conversation

@ericholscher
Copy link
Member

Summary

  • document the spike to restore /page/ redirects on subprojects
  • make ServePageRedirect resolve subprojects from either the current project, alias, or slug
  • add a regression test covering /projects/<subproject>/page/ redirects
  • document how to run the subproject page-redirect test with the proxito settings
  • fix a ruff lint warning in ServePageRedirect by removing an unused import

Testing

  • DJANGO_SETTINGS_MODULE=readthedocs.settings.proxito.test uv run pytest readthedocs/proxito/tests/test_old_redirects.py::InternalRedirectTests::test_page_redirect_on_subproject -vv -s
  • uv run ruff check readthedocs/proxito/views/serve.py readthedocs/proxito/tests/test_old_redirects.py

Codex Task

@ericholscher ericholscher requested review from a team as code owners December 2, 2025 20:05
@ericholscher ericholscher requested review from stsewd and removed request for agjohnson December 2, 2025 20:05
@read-the-docs-community
Copy link

read-the-docs-community bot commented Dec 2, 2025

Documentation build overview

📚 dev | 🛠️ Build #30541339 | 📁 Comparing 58191a4 against latest (1292c9f)


🔍 Preview build

Show files changed (6 files in total): 📝 6 modified | ➕ 0 added | ➖ 0 deleted
File Status
contribute.html 📝 modified
install.html 📝 modified
search-integration.html 📝 modified
style-guide.html 📝 modified
design/embed-api.html 📝 modified
design/theme-context.html 📝 modified

@read-the-docs-community
Copy link

read-the-docs-community bot commented Dec 2, 2025

Documentation build overview

📚 docs | 🛠️ Build #30541340 | 📁 Comparing 58191a4 against latest (1292c9f)


🔍 Preview build

Show files changed (20 files in total): 📝 17 modified | ➕ 0 added | ➖ 3 deleted
File Status
build-customization.html 📝 modified
link-previews.html 📝 modified
support.html 📝 modified
visual-diff.html 📝 modified
about/index.html 📝 modified
config-file/v2.html 📝 modified
intro/antora.html 📝 modified
intro/doctools.html 📝 modified
intro/docusaurus.html 📝 modified
intro/markdoc.html 📝 modified
intro/mdbook.html 📝 modified
intro/mkdocs.html 📝 modified
intro/mystmd.html ➖ deleted
intro/sphinx.html 📝 modified
intro/vitepress.html 📝 modified
intro/zensical.html ➖ deleted
reference/main-content-detection.html ➖ deleted
server-side-search/index.html 📝 modified
tutorial/index.html 📝 modified
tutorials/index.html 📝 modified

Comment on lines +98 to +102
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"},
)
Copy link
Member

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.

@stsewd
Copy link
Member

stsewd commented Dec 16, 2025

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.

@ericholscher
Copy link
Member Author

ericholscher commented Dec 17, 2025

@stsewd
Copy link
Member

stsewd commented Dec 17, 2025

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.

@ericholscher
Copy link
Member Author

Huh... ok 🤔

@ericholscher
Copy link
Member Author

I will close this then, and let the user know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants