-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Docs: Add some details to the User Defined Redirects #7894
Docs: Add some details to the User Defined Redirects #7894
Conversation
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.
Thanks for the update!
docs/user-defined-redirects.rst
Outdated
Since we serve documentation in a highly available way, | ||
we do not run any logic when we're serving documentation. | ||
This means that redirects will only happen in the case of a *404 File Not Found*. | ||
|
||
In the future we might implement redirect logic in Javascript, | ||
but this first version is only implemented in the 404 handlers. |
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.
this is a little out of date, we run some logic when serving docs now. I think we can just mention that redirects only work on 404 (and maybe leave the second paragraph that mentions the js solution too).
readthedocs.org/readthedocs/proxito/views/serve.py
Lines 126 to 135 in c857c6c
# TODO: un-comment when ready to perform redirect here | |
# redirect_path, http_status = self.get_redirect( | |
# final_project, | |
# lang_slug, | |
# version_slug, | |
# filename, | |
# request.path, | |
# ) | |
# if redirect_path and http_status: | |
# return self.get_redirect_response(request, redirect_path, http_status) |
I think at this point we only need to make the decision on how to implement them and how to make it in a way that doesn't introduce a lot of queries to the db.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
- Move the "Implementation" section further up as a note, so that it's more visible (I missed it myself and spent some time trying to test redirects on 200 which do not work). Remove part about not running logic as it's no longer accurate. - Add mentions to the use case of setting Exact Redirects to have Page Redirects but applied only to a specific version. It's common to move pages only in the `latest` branch/future stable branches, without doing the change in older branches. - The button to confirm a redirect is now named "Add".
716541a
to
9c03f44
Compare
Sorry for the late update. I've addressed the above feedback (the rewrite of the |
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.
Thanks!
more visible (I missed it myself and spent some time trying to test
redirects on 200 which do not work).
Page Redirects but applied only to a specific version. It's common
to move pages only in the
latest
branch/future stable branches,without doing the change in older branches.
I'm happy to amend the commit as needed if you disagree with some of the proposed changes.