Skip to content
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

Redirect .../index.html links from Sphinx HTMLDir #2208

Merged
merged 1 commit into from
May 17, 2016

Conversation

rkday
Copy link
Contributor

@rkday rkday commented May 12, 2016

We recently switched from a Sphinx HTMLDir-style layout to Sphinx HTML. The redirect we have in place handles links of the form http://clearwater.readthedocs.io/en/stable/Clearwater_SNMP_Statistics/, but not http://clearwater.readthedocs.io/en/stable/Clearwater_SNMP_Statistics/index.html (which used to work, and we have a lot of now-broken links in that format).

This PR makes the latter style of link redirect correctly. I was worried that it would affect links like http://clearwater.readthedocs.io/en/stable/index.html (redirecting to http://clearwater.readthedocs.io/en/stable.html), but I checked and get_redirect_response is only called from the 404 handler at https://github.com/rtfd/readthedocs.org/blob/a3e5cf3134c5db089d30451fdd89f77a2ad354a1/readthedocs/core/views/__init__.py#L123, so it won't spuriously redirect pages that otherwise work.

@ericholscher
Copy link
Member

Thanks :)

@ericholscher ericholscher merged commit 6a5dec7 into readthedocs:master May 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants