How to block special URL


I see a ton of requests that are invalid from chatgpt to pages like:

I would like to block any time there is a number that doesn’t have before

These would work:

Would love to get some insights.

Thank you

Try this:

(http.request.uri.query contains "page") and ((ends_with(http.request.uri.path, "0")) or (ends_with(http.request.uri.path, "1")) or (ends_with(http.request.uri.path, "2")) or (ends_with(http.request.uri.path, "3")) or (ends_with(http.request.uri.path, "4")) or (ends_with(http.request.uri.path, "5")) or (ends_with(http.request.uri.path, "6")) or (ends_with(http.request.uri.path, "7")) or (ends_with(http.request.uri.path, "8")) or (ends_with(http.request.uri.path, "9")))

If there’s a query string with “page”, AND the path ends with a digit, then block.

1 Like

but then it would block which is a legit page, no?

No. That digit is in the query string. Not the path.

Have you tried the rule?

1 Like

I have tried and it blocked the wanted page

I just re-tested, and it’s working as expected for me:

The above URL gets redirected by the server, but not blocked by Cloudflare.

If you run it through Cloudflare Trace, you should be able to see which rule is blocking it.

1 Like

You are right, I just tried again and it works.

thank you


what would be a way to block also pages like this:

@sdayman i tried this one

(http.request.uri.path contains "/s/" and not http.request.uri.path contains "page|pageNumber" and http.request.uri.path contains "\\/[0-9]+$")

but it didn’t work, what am I missing here?

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.