Redirects Rules

Hello, I would like to know if someone could help me with my case. I have a redirection rule on my domain so that it is only accessible with a specific user agent, but I need google ads to be able to find /ads.txt (is there a way to prevent the rediction rule from applying to this file?)

You could use:

(http.host eq "example.com" and http.user_agent ne "<USER-AGENT STRING>" and http.request.uri.path ne "ads.txt")
Then
Redirect to https://example.com/<TARGET PATH FOR OTHER REQUESTS>

However…

  1. You should probably use a WAF rule is the intention is to block undesired requests
  2. User-agent strings are easy to forge, and either a Redirect Rule or a WAF Custom Rule would be therefore easy to circumvent.