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

"This page has moved" shouldn't have status code 200 #760

Open
mistydemeo opened this Issue Jun 10, 2017 · 21 comments

Comments

Projects
None yet
9 participants
@mistydemeo
Copy link

mistydemeo commented Jun 10, 2017

Google and other search engines are still serving search results from the first edition of the book; for example, this link was the first result for "rust ownership". I noticed that they're being served up with a status code of 200 - should this be 301 or 410 to let them be purged from the index and replaced with a current URL?

@steveklabnik

This comment has been minimized.

Copy link
Member

steveklabnik commented Jun 10, 2017

My understanding was that the way I did it was supposed to be "similar to a redirect", so I assumed it gave the right code :(

@carols10cents

This comment has been minimized.

Copy link
Member

carols10cents commented Jun 13, 2017

I have no idea what the right thing to do here is, or how to implement that right thing. I'd love help!

@hschmidt

This comment has been minimized.

Copy link

hschmidt commented Jun 20, 2017

A 301 would affect search engines and human visitors alike, effectively making the 1st edition unreachable to both. Since both editions should coexist while the 2nd edition is being written, redirecting from 1st to second edition now would be the wrong thing to do. Once the 2nd edition has been released, all current links pointing to the 1st edition should result in a 301 to the appropriate page in the 2nd edition. The 1st edition should be archived by moving it to a new location, optionally with a robots.txt rule to prevent search engines from crawling it.

@steveklabnik

This comment has been minimized.

Copy link
Member

steveklabnik commented Jun 20, 2017

Since both editions should coexist while the 2nd edition is being written, redirecting from 1st to second edition now would be the wrong thing to do.

To be clear, this bug isn't about removing the first edition; it's about the old first edition URLs pointing to the location of the first edition as it stands today.

@Gedweb

This comment has been minimized.

Copy link

Gedweb commented Jun 20, 2017

If look documentation of some other project - several versions of documentation live with version prefix. Just leave old version on his place or redirect with 301 status code to new location.
Recently, he outstripped the game of the same name and we break links - shit!

@Gedweb

This comment has been minimized.

Copy link

Gedweb commented Jun 23, 2017

Let's play a game
https://doc.rust-lang.org/stable/book/slice-patterns.html

Some progress on this issue? Have a suggest?

@hschmidt

This comment has been minimized.

Copy link

hschmidt commented Jun 23, 2017

Since both editions should coexist while the 2nd edition is being written, redirecting from 1st to second edition now would be the wrong thing to do.

To be clear, this bug isn't about removing the first edition; it's about the old first edition URLs pointing to the location of the first edition as it stands today.

Gotcha. I was not aware of the fact that 1st edition pages changed URLs. In that case, a simple 301 from old URL to new URL is the way to go. So following the example from the OP, a request to

https://doc.rust-lang.org/book/ownership.html

should return a 301 response with a Location: header set to

https://doc.rust-lang.org/book/first-edition/ownership.html

I would need to know more about where/how doc.rust-lang.org is hosted to make a recommendation on how to do that.

@steveklabnik

This comment has been minimized.

Copy link
Member

steveklabnik commented Jun 23, 2017

Soooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo re-reading this issue, I feel dumb. Let me back up a second.

I have done two recent things with redirects:

  1. the ones this issue has talked about
  2. we stopped hosting the book on github pages now that it's on doc.rust-lang.org

I have conflated these two in my brain, so my first reply here was thinking about 2, when this issue was about 1.

For 2, we did this https://github.com/rust-lang/book/blob/gh-pages/index.html#L7

We could do this for 1 as well.

@Gedweb

This comment has been minimized.

Copy link

Gedweb commented Jun 23, 2017

Nope, server redirection required. Search engines not execute JS. I VERY RECOMMEND return back first edition, we lose position in search results.
And no matter where early hosted docs, don't mind about that.

A huge numbers of links now wrong (stackoverflow, reddit, blogs..)
This undermines the reputation of the language itself.
Website is not a book, current situation is CRITICAL, I hope you understand it.

@ScottAbbey

This comment has been minimized.

Copy link
Contributor

ScottAbbey commented Jun 23, 2017

a request to

https://doc.rust-lang.org/book/ownership.html

should return a 301 response with a Location: header set to

https://doc.rust-lang.org/book/first-edition/ownership.html

Agreed. Clearly the best approach when there is an obvious new target.

@steveklabnik

This comment has been minimized.

Copy link
Member

steveklabnik commented Jun 23, 2017

Search engines not execute JS.

This is not really true, but it's also not here nor there.

@Gedweb

This comment has been minimized.

Copy link

Gedweb commented Jun 23, 2017

@steveklabnik believe first link in google, don't look down. 2015 year, Carl!

@ScottAbbey, hotfix or rollback — no time to discuss. Solve problem and release again with second edition. Page with choice is rashly solution.

@Gedweb

This comment has been minimized.

Copy link

Gedweb commented Jun 24, 2017

So, simple solution — just add rule for http-server. Ready to help if required, but please do something.

@steveklabnik

This comment has been minimized.

Copy link
Member

steveklabnik commented Jun 27, 2017

@Gedweb there is no controllable http-server; this is an s3 bucket.

@Gedweb

This comment has been minimized.

Copy link

Gedweb commented Jun 27, 2017

@steveklabnik, so.. maybe replace it to ec2. Using static website is old problematic way, but without direct access to http-server just a pain.

And how i see, s3 allow using redirect with an configuration file, like that

@brson

This comment has been minimized.

Copy link
Contributor

brson commented Jul 13, 2017

The documentation does go through nginx so could have dedicated rules for all the old links.

Edit: that nginx server's config should really be in a public repo because it is gnarly and if we lost it we would cry heavy tears.

@dlight

This comment has been minimized.

Copy link

dlight commented Jul 22, 2017

If the concern is that people will miss later editions when checking a link from the first edition, one could simply put a note on top of every first edition chapter with the same contents as the disambiguation message, with a "x" to close, and make the browser remember you closed it.

That way, new book editions would still be discoverable even after doing a 301 redirect ("moved permanently").

@Gedweb

This comment has been minimized.

Copy link

Gedweb commented Jul 24, 2017

In primary we can see version selector on a page.

Looks, here an example of correctly documentation site. I want pick your attention on url path when toggle version.

So, if we have broken links and can't repair (now it's not required - too late) we need create solution which can avoid this problem in future.

@dlight

This comment has been minimized.

Copy link

dlight commented Jul 25, 2017

That would be cool, even though there isn't a 1:1 correspondence between chapters of different book versions (they can be merged, splitted, etc). That way, someone reading about a subject on the first book could jump to roughly the right place on the second.

@Gedweb

This comment has been minimized.

Copy link

Gedweb commented Nov 11, 2017

Still was nothing happened. Second edition incomplete and have alert, links to the first edition broken.

@damoasda

This comment has been minimized.

Copy link

damoasda commented Dec 23, 2018

I was also wondering why Google links to Rust documentation pages with no content. If I google for "rust ownership" as mentioned in the original post by @mistydemeo, the first result links to a "second edition", but the page has no content except a warning and links to other versions.

To get an overview of the currently existing versions I tried to collect all versions for "rust ownership":

I suggest the following:

  1. Restore old page versions to make Google links useful again, as in the example above.
  2. Add a header to every page with the book version and a link to the domain root to find the latest version. I wouldn't link to the latest version directly to avoid maintenance effort.
  3. For future versions should always use a version prefix in the URL path. I wouldn't use URL paths like "/stable/" or "/latest/" as the content will change from time to time. The latest stable version can be linked from the domain root.

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.