My website has been spammed by hackers for maybe 1 year. So now I have to update everything I think. And it seems that the page targetted by spammers is going to 404.
My question : I tested this command on htaccess to redirect 404 page to 410 but it's not working.
The spammed urls are like this
example.com/date-women..
example.com/need-women..
example.com/need-men-usa
example.com/old-women..
(Where example.com
is my website.)
So I need to ask htacess to redirect 404 of these spams to 410
# If the request is not for a valid directory
RewriteCond %{REQUEST_FILENAME} !-d
# If the request is not for a valid file
RewriteCond %{REQUEST_FILENAME} !-f
# If the request is not for a valid link
RewriteCond %{REQUEST_FILENAME} !-l
# 410 gone for a long string of lowercase letters
# and/or numbers followed by an optional long extension
# to handle spam URLs like /spstyaaliti4csf6ne.desiringly
RewriteRule ^/?[date](\.[women]?$ - [G,L]
it's not working?
I have about 500 pages to declare on Bing and Google Search Console. So it's better to erase them using 410 with htaccess.
Can you help ?