One of the sites I manage was hacked, probably via a plugin. I updated WP & etc… the original issue is corrected. however, in addition to being hacked, over 5000 backlinks now exist linking to this site. I am concerned about the consequences, SEO-wise.
I want to make all of the old urls go to 404. I did not have permalinks set up prior to the hack, so all the old urls are /?xyz=zxy style. I’ve now turned on permalinks, so basically, I want ALL the /?xyz style requests to go to 404.
I’ve tried a number of things with mod_rewrite…
RewriteRule ^\? - [R=404,L]
But the above code does not work. The old links still link to content, they are not redirected to 404.