How do i serve 410 status code over 404 in joomla? So that google will de-index my pages from serach results.
Please provide all methods in detail.
How do i serve 410 status code over 404 in joomla? So that google will de-index my pages from serach results.
Please provide all methods in detail.
You would have to do this in the .htaccess. Similar format to 301 redirects but only putting the URL you want to disappear. Please note, this can still take months.
Redirect 410 /old-page-you-do-not-want
Also, make sure you are updating your robots.txt to suggest to search engines to not crawl:
Disallow: /old-page-you-do-not-want
Not sure why your original question was downvoted. In any case, please check this post on the right way to return 404 in Joomla. Then, when implementing the post, replace the following line:
header('HTTP/1.0 404 Not Found');
with
header('HTTP/1.0 410 Gone');
I am not 100% sure that returning 410 instead of 404 for everything is a good idea though.