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

Url fragment is lost due to redirection #1347

Open
runephilosof-abtion opened this issue May 30, 2024 · 4 comments
Open

Url fragment is lost due to redirection #1347

runephilosof-abtion opened this issue May 30, 2024 · 4 comments

Comments

@runephilosof-abtion
Copy link

runephilosof-abtion commented May 30, 2024

On https://bundler.io/guides/using_bundler_in_applications.html#gemfilelock

* `PLATFORMS` - platform that is used in your application ([see more here](/man/gemfile.5.html#PLATFORMS)).

The link to /man/gemfile.5.html#PLATFORMS will be redirected to /v2.5/man/gemfile.5.html, by the backend

redirect url, to: latest_man

So the fragment #PLATFORMS will never have an effect.

Could it link to the current version instead?

@deivid-rodriguez
Copy link
Member

Indeed. I'm unsure how to fix this. We could make this guide use a haml template instead of markdown and dinamically link to the latest version, or hardcode the latest version in the target URL, and make sure we update it every time we release a new minor version of Bundler. None of them feel great :(

@runephilosof-abtion
Copy link
Author

I just realized that browsers of course persist the #PLATFORMS part, when they are redirected.
However, it seems the backend is not redirecting with a http status 302 (or 307), but instead responding with 200 OK and this body.

              <html>
                <head>
                  <link rel="canonical" href="/v2.6/man/gemfile.5.html" />
                  <meta http-equiv=refresh content="0; url=/v2.6/man/gemfile.5.html" />
                  <meta name="robots" content="noindex,follow" />
                  <meta http-equiv="cache-control" content="no-cache" />
                </head>
                <body>
                </body>
              </html>

If the backend would instead use a redirection status and location header, it should work.

@runephilosof-abtion
Copy link
Author

I can't find a way to get github pages to send a redirection response.

@deivid-rodriguez
Copy link
Member

I think middleman always uses client side redirects. This seems bad for SEO and I think it explains the issues in #1333.

I think we can fix both this and #1333 by not using middleman redirect and instead creating symlinks between /man/ and v2.6/man (updated every time we bump the major version). We will serve duplicated content, but our canonical meta tags should keep Google happy I believe.

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

No branches or pull requests

2 participants