Hi @alejandrodemena,
TL;DR version:
Using 410 is for what you’re trying to do wrong. Use 301, 302, 303, 307 or the non-standard 308.
Preferably 301.
This is what you should know:
3xx status codes are for client obligations. Like redirects and cache.
4xx status codes are for client errors. Like missing files, locations or authorization barriers.
Both Browsers and Search Engines take these codes very seriously (aside from 418, which indicates that the server is a teapot).
From the RFC 7231 spec, section 6.5.4:
The 404 (Not Found) status code indicates that the origin server did not find a current representation for the target resource or is not willing to disclose that one exists. A 404 status code does not indicate whether this lack of representation is temporary or permanent; the 410 (Gone) status code is preferred over 404 if the origin server knows, presumably through some configurable means, that the condition is likely to be permanent.
In other words, use 410 only if 404 is not by accident.
What does this mean?
From section 6.5.9:
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.
This means that all external links to those 410 response pages are completely rendered useless. This implies that you lose all SEO value for those links.
So… what should I do?
Given the circumstances… you know where the better or newer document is.
So… use 301!
From section 6.4.2:
The 301 (Moved Permanently) status code indicates that the target resource has been assigned a new permanent URI and any future references to this resource ought to use one of the enclosed URIs.
In other words, your website tells the visitor this:
“A newer, flashier, better, nicer, etc. document is available, and I know where it is. You must go there… bot or human (or dog)!”
This means that all external links to those 301 response pages are completely rendered useful. This implies that you maintain all SEO value for those links.
The details
If we dive into the code for 410, no redirect is ever written into it. So all you get are bugs and unexpected results.
In Blink (Webkit’s successor) source code, the browser implies to returns a “null pointer” if the status code is not 301, 302, 303, 307 or 308 on a redirect request (this is indicating a fail):
https://chromium.googlesource.com/chromium/blink/+/fb5d8964779a6ee59d4fd046d3414f744c6b6197/Source/modules/fetch/Response.cpp#269
Otherwise, it will continue to line 274 where it will setup the response status for the browser (line 277 listens to the location). Anything else would imply a misconfiguration.
This has been the case for about 18 months now, and probably much longer.
I hope you’ve learned a bit about response headers from this massive wall of text ?? Cheers!