I need to return 410 Gone for a bunch of URLs that shouldn't have been crawled in the first place and are now 404ing. We've fixed the error that caused them initially, but there are around 3000 that have been indexed. These are all dynamic and follow patterns such as:
I would like to use .htaccess to return 410 Gone for these (as suggested by a kind person on the SEO forum) but I'm unsure of how to implement regex to catch all of these. Any help would be massively appreciated.