开发者

Should I use 404 Not found or 410 Gone for a bulletin board system, when a topic is deleted?

I'm creating a bulletin board system, and now I'm implementing a 'delete topic' feature for admins. If someone opens the deleted topic, the server cannot find it, so it must be 404. On the other hand, the topic has existed sometime, so I must use 410. Implementing the 410 would require a new table called deleted_topics, and so would require more space. However, 410 I think is better for search engines. What do you think? Should I use 404 or 410?

404 Not found

The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent. The 410 (Gone) status code SHOULD be used if the server knows, through some internally configurable mechanism, that an old resource is permanently unavailable and has no forwarding address. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable.

410 Gone

The requested resource is no longer available at the server and no forwarding address is known. This condition is expected to be considered permanent. Clients with link editing capabilities SHOULD delete references to the Request-URI after user approval. If the server does not know, or has no facility to determine, whether or not the condition is permanent, the status code 404 (Not Found) SHOULD be used instead. This response is cacheable unless indicated otherwise.

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. Such an event is common for limited-time, promotional services and for resources belonging to individuals no longer working at the server's site. It is not necessary to mark all permanently unavailable resources as "gone&quo开发者_如何学Got; or to keep the mark for any length of time -- that is left to the discretion of the server owner.

Thanks,


Showing a 410 requires a little more effort than a 404 because to know it's a 410 you need to maintain at least a "ghost" of the former page in your database. If this is not a problem to you, I'd consider the 410 "better" and "friendlier" because it presents more information. If you don't want to be hassled with maintaining a graveyard in your database, then 404 is acceptable too, of course.

I don't like Alohci's approach of redirecting to a different page. The end result looks like the user ended up on the "input new topic" page (or whatever) by accident. This works, but I think a preferable solution would be to create a custom 410 page (or 404 page, if you don't want to support 410) with specific information for the case at hand. I.e. your 410 shouldn't just say "gone", it should say "this post has been deleted, here's a link to similar posts or a link to create a new post". Your "404" wouldn't have quite as much information available but it could still offer a subset of such information and links.

I guess the "custom 410 page" comes close in appearance to "redirecting with 301" but an important difference is that robotic users of your site (of which there are many!) will get the more accurate status, and know to purge the old link from their crawl index – this will ultimately save them and you some unnecessary traffic.


I think the correct way to do this is by sending the 410 Gone for some time and after a few weeks/months to switch to 404 Not found. Of course, it is for you to decide if that is worth the amount of time and effort.


Neither. Since you tagged your question 'SEO' I'm assuming you want the best SEO answer. If there are any backlinks (coming from outside sites) to your deleted topic all the 'link juice' will be lost with 404 and 410 status.

Instead you should definitely create some 301 redirects which point to the root of the site, the root of the forum, or a related category. You will thus preserve the link juice and you get to decide which pages of your site will benefit most.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜