-
-
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
Redirect full path to default version #4673
Comments
I think this is what you need #2422 (comment) |
Although, you'll need to change the redirect on each release |
An exact redirect from The redirects catch too much, they should only trigger for 404s that don't already start with the |
I'd rather not have to update these redirects as new releases occur either, as part of the draw of moving to RTD was that we could drop our custom bots and processes for building docs. |
@davidism your issue called my attention because I thought that we supported this. I found a hacky solution, I think. This URL,
How I did it? I created a This brought other issues:
From your examples,
This one can be achieved by an
Similar Redirect can be done for this one,
The hacky way that I found should solve this one (although, it should be implemented in a better way),
Finally, maybe this can be achieved by
So, accessing I'm listing all of this here but I know it doesn't sound like a "good answer". I want to be sure that, even with a hacky way we can make this work or not. This will probably need some changes in our implementation of redirects --which is kind of complicated. Finally, if you add a namespace in your the URLs you want to link, like https://gh-rtd-project-a.readthedocs.io/redirect-to-default-version/redirect.html With a shorter namespace, https://gh-rtd-project-a.readthedocs.io/r/redirect.html So, your URLs will be in the form https://click.palletsprojects.com/r/windows Does any of this make sense to you? 😁 |
Thanks, I started using prefix and exact redirects in an earlier comment. The problem with all these is that any 404 now produces an infinite redirect with a weird repeated URL. It's not end-user friendly. |
If that bug is fixed and just returns a 404, that would be enough for your use case? |
Yeah, I think that should cover it. |
@davidism I merged the fix for the infinite redirect. It will be deployed soon. |
I'd like to be able to create versionless links to the documentation, for use in error messages, code comments, etc. For example, a message like
see https://click.palletsprojects.com/windows for more information
. I don't want to use URLs with versions because I would have to remember to modify all instances of it before releasing a new version.Currently, only the root path redirects to the default version, other paths raise a 404. Instead, the path should be preserved and appended to the default version path on redirect.
I do not want to use the "latest" or "stable" versions because I would like the URLs that people land on and share to contain the actual version.
I already do this with the transitional redirects I set up from
click.pocoo.org
toclick.palletsprojects.com
. A similar approach could probably be used to extend RTD's default redirect.The text was updated successfully, but these errors were encountered: