WAF > URI Path doesn't have "starts_with" or "ends_with" as an option

In my Apache configuration, I block a lot of requests when REQUEST_URI starts with or ends with certain words. An example is when it begins with /wp; I don’t use Wordpress, so this is obviously a bot trying to break in. Another example is when the path ends with .gz or .log.

I was going to move this to a Cloudflare WAF rule to take a little stress off of the server, but I don’t see an option in the expression builder for “starts with” or “ends with”.

Can I use them, anyway, or are they excluded for a reason?

Did you try this?

(starts_with(http.request.uri.path, ""))
1 Like

I haven’t tried anything yet :slight_smile: I had seen “starts_with” and “ends_with” in other rules, but since they weren’t given as options in the WAF expression builder I thought that there might be a reason for it.

It wasn’t supported for a while, but should work now AFAIK.

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