Allow Specific URL only

Domain:

I would like to allow the specific URL such as: /test/* Rest should be blocked for the above domain.

It means only: * are allowed other directories should be blocked.

An irule would work, something like:

when HTTP_REQUEST {    if {  ![string tolower [HTTP::uri]] starts_with "/test/" } {   HTTP:: respond 404 noserver     }  }