Blocking particular URL/file patterns

apache 2.4.39
linux 4.12.14-lp151.28.7-default x86_64

Our site has beset with numerous search engine queries for URLs that
have *never* existed on the site. They have the form:


where the digits are randomly changed. The search bots of Google and
Bing are the most prevalent producing 1000s of 404s per day. Not a
particular CPU burden, to be sure. Annoying nevertheless.

The following blocks the bots but also legitimate requests as well.
deny from googlebot
deny from bingbot
deny from
deny from

Is there a way to write a filter that blocks the above URL patterns
without generating a 404 response?


Re: Blocking particular URL/file patterns

By LuKreme at 07/02/2019 - 19:36

On 2 Jul 2019, at 14:16, James Moe <> wrote:

Have you looked into robots.txt? And a sitemap?