My site got hacked recently and has over 3 million pages now when it only has 30 pages (see screenshot).
How do I implement the correct 410 header in .htaccess
?
I think the best tactic is to 410 all pages that contain a number OR .htm OR .html
as none of the real pages have these in the URL. For example -
https://example.com/cixc-20050gsakuramar/-b00006.htm
https://example.com/sfumato.php?nzlw-21833vetidm4
https://example.com/bzmt-5694ceti.html
https://example.com/pfks-14602sjp/ucqksti.htm
https://example.com/admv-15974mitem/318
Would this code work?
Redirect 410 /*0*
Redirect 410 /*1*
Redirect 410 /*2*
Redirect 410 /*3*
Redirect 410 /*4*
Redirect 410 /*5*
Redirect 410 /*6*
Redirect 410 /*7*
Redirect 410 /*8*
Redirect 410 /*9*
Redirect 410 /*.html*
Redirect 410 /*.htm*
I've also pieced together a rewrite rule which might also work?
RewriteRule ^([0-9]+)$ - [G,L]
I am also thinking of adding Disallow to robots.txt
like this -
Disallow: /*0*
Disallow: /*1*
Disallow: /*2*
Disallow: /*3*
Disallow: /*4*
Disallow: /*5*
Disallow: /*6*
Disallow: /*7*
Disallow: /*8*
Disallow: /*9*
Disallow: /*.htm
Disallow: /*.html