35

Yesterday I have posted an answer to the question How to get parent id of a root node from front end to insert a child node into list?, and the OP posted some comments that got into my inbox:

screenshot

However, when now browsing to the question, I'm getting Page Not Found which I believe means the OP or someone else deleted the message for some reason.

In my opinion, it's better to show "Question has been deleted [by ...]" instead, at least for one day or for members who were "active" in the question otherwise it's pretty confusing.

1 Answer 1

38

Based on additional feedback, I elected to implement this in a better way.

When viewing a 404 page:

If the question was deleted by somebody else, and you are the author

Your question was removed from Stack Overflow for reasons of moderation. Please refer to the FAQ for possible reasons why your question might have been removed.

If the question was deleted by somebody else, and you are not the author

This question was removed from Stack Overflow for reasons of moderation. Please refer to the FAQ for possible reasons why a question might be removed.

If the question was deleted by its author, and you are the author

This question was voluntarily removed by its author – that's you!

If the question was deleted by its author, and you are not the author

This question was voluntarily removed by its author.

This text appears at the top of the page with revision highlights on the relevant bits of text. The rest of the 404 page was not changed (for the purposes of this answer, I did clean up some display issues).

12
  • Thanks Jeff that's exactly what I asked for - and I love the yellow highlight! Guess now less people will come here wondering "what happened to this question". :) Apr 4, 2011 at 7:36
  • 7
    It seems just slightly redundant to still have "We couldn't find the page you requested." You could find it; you found it; it had been deleted; you told us so. I definitely like that it now says when a question has been deleted, but on those 404 pages, don't you think saying that it couldn't be found is a bit... incorrect?
    – nhinkle
    Apr 4, 2011 at 8:34
  • 1
    @nhinkle - it's technically correct from the browser point of view. The page status is still 404 as far as I can tell. Apr 4, 2011 at 12:06
  • 10
    @shadow It would be more technically correct to say, 550 Permission Denied since the post exists, but the user does not have rights (ie, 10k rep and signed in) to view it. However, that would likely result in a slew of support inquiries regarding whether one is logged in correctly since so few people are used to and comfortable with the variety of HTTP status codes that exist - save for 404, page not found. I'd prefer a permission denied, but I can understand why a company might choose instead to placate the user with a simpler, though incorrect, message.
    – Pollyanna
    Apr 4, 2011 at 13:51
  • @Adam good point, but probably 404 is for the best for the reasons you said. :) Apr 4, 2011 at 13:59
  • @ShadowWizard the browser is not parsing the HTML on the page, seeing "we couldn't find the page you requested", and interpreting it as a 404. It's seeing the HTTP header and determines based on that. The status code sent is correct from a browser point of view; the text on the page is incorrect from a human point of view.
    – nhinkle
    Apr 4, 2011 at 17:24
  • @nhinkle I think you are massively overthinking this, personally.. :p Apr 4, 2011 at 20:51
  • And @nhinkle, have you been suffering the IE so-called friendly HTTP error messages? ;-)
    – Arjan
    Apr 14, 2011 at 14:06
  • @Arjan Me? Use IE? Pshaw. No, I've been seeing the correct page. It's just a minor quibble.
    – nhinkle
    Apr 14, 2011 at 17:20
  • 4
    @nhinkle: since we are nitpicking 404 is not the correct status for deleted questions, it should be 410 Gone Aug 15, 2011 at 0:57
  • 1
    Yes, 410 looks like a better status code here. Aug 15, 2011 at 8:24
  • @Koper, a bit late, but see Deleted questions should return 410 Gone instead of 404 Not Found as for why (apparently) 404 is better than 410.
    – Arjan
    Mar 21, 2012 at 18:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .