I'm working on a site that has been hacked, and am trying to remove the thousands of invalid search results.
Looking at the server logs I'm finding examples like this:
"GET /Z7WybgVLc/ HTTP/1.1" 200
Of course, these entries don't exist, at least not for now...
In the htaccess file I've created these rules:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^[a-z0-9]{9}\/$ index.php [G,L,NC]
RewriteRule ^[a-z0-9]{8}\/$ index.php [G,L,NC]
RewriteRule ^[a-z0-9]{7}\/$ index.php [G,L,NC]
The idea is to return GONE for any random requests of 7,8, or 9 characters/numbers that ends with "/".
I've tested this, and it seems to work. However, since mod-rewrite is nothing but voodoo, I thought I'd ask to see if I'm missing anything that should be obvious.