I understand what is http code 410 (gone) vs 404 (not found) is. I am wondering if a page never existed (Wrong URI entered by the user), is it ok to return 410 instead of 404 ? I know 404 is what most sites would return in this case. Is there any harm in returning 410 ?
2
Answers
To answer your question directly, there should be no ‘harm’ to return a
410 status code
instead of a404 status code
in this scenario.However, returning a
410
for a ressource that never existed in the first place is misleading and should not be done.The whole point of the status code is to be as clear as possible as to why it succeeded/failed for the user who receives it. By sending a
410
, the user might think this ressource once existed and might try alternative URLs to access it. By using a404
in this context, the user will know that this ressource never existed in the first place.A 410 status code means that you deleted a page on purpose and you don’t want it back. This tells search engines to forget about that page quickly and not to bother looking for it again. A 404 status code means that you can’t find a page, but maybe it will come back later. Search engines will keep checking that page to see if it changes.
If you use 410 status code for a page that was never there, your server has to be able to handle that code and you have to be sure that you will never create that page in the future. Otherwise, you might confuse search engines and users who might wonder what happened to that page. A 404 status code is better for pages that were never there and never will be.
https://mysagaventure.com/404-vs-410-status-errors-whats-the-difference-and-how-to-fix-them/