I have removed a forum system from my CMS and now I want to return an 410 status code whenever a search engine visits the former posts. I know that I have to use a number of Rewrite Rules to do the job, but I can't get them working.
The base URLs of the forum that I have removed are like these:
Posts -> mywebsite.com/forum-viewtopic-p-xxx.html
Topics -> mywebsite.com/forum-viewtopic-t-xxx.html
Subforums -> mywebsite.com/forum-viewforum-f-xxx.html
Taking that into account, these are a couple of examples of the code I have added to my .htaccess:
RewriteCond %{QUERY_STRING} forum-viewtopic
RewriteRule .* - [G]
RewriteCond %{QUERY_STRING} forum-viewforum
RewriteRule .* - [G]
I don't know that I am doing wrong, but the HTTP headers of these forum posts show a '404 Not Found message' instead of a 410 error.