Return something else than a 404 for deleted subjects

Hi,

What do you think about returning something else than a 404 for the deleted subjects ?
I’ve regularly some errors in Google Webmaster Tools when I delete some subjects. Could you send an other error code to indicate the page has been removed?

2 Likes

What do you mean by hidden subjects? Can you be specific and give an example?

1 Like

For example this page: https://forum.pragmaticentrepreneurs.com/t/enquete-pour-un-projet-dentreprise/3579 (it returns a 404 currently)

Here is what it looks when you are an admin:

It looks deleted, not just unlisted. That’s why the body content is that pink color – that means deleted.

Yes sorry.
But is it a good idea to send a 404 in this case?

Uh, yeah, since it is deleted.

2 Likes

Completely correct, when you delete a file from a web server you get a 404, this is exactly the same thing conceptually

2 Likes

Why not using a 410 Gone ?

What difference does it make? How does that help anyone? What purpose would such a change serve?

The 410 response is primarily intended to assist the task of web maintenance by notifying the recipient that the resource is intentionally unavailable and that the server owners desire that remote links to that resource be removed

http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

3 Likes

Cutts:

“If a page is gone and you think it’s temporary, go ahead and use a 404. If the page is gone and you know no other page that should substitute for it, you don’t have anywhere else that you should point to, and you know that that page is going to be gone never come back, then go ahead and serve a 410.”

2 Likes

We are re-evaluating this in the light of some 403 problems, I think I am conviced 410 gone is more correct for public deleted topics… @riking will be working on it.

1 Like

That change is in:

https://github.com/discourse/discourse/pull/3785/

This snippet is what error codes we’re currently giving out:

https://github.com/discourse/discourse/blob/c9e4745fe8081430079c25edbba0b5211dd9a28c/spec/controllers/topics_controller_spec.rb#L595-L636

The “private (message) topic → 302” seems a bit weird, especially since we give a 403 (same as secure category) for signed-in users.

2 Likes