blocking uri

hi, i need to block all uri on the website with below iRule but not working fine:

when HTTP_REQUEST { if { [string tolower [HTTP::host]] contains "; and ($uri contains “/”)} { HTTP::redirect ";

}

}

please help me.

Try using the following:

when HTTP_REQUEST {
 if { ([string tolower [HTTP::host]] contains "www.example.com") 
      && ( [string tolower [HTTP::uri]] contains "/") }
 {
 HTTP::redirect https://www.test.com
 }
 }

Try using the following:

when HTTP_REQUEST {
 if { ([string tolower [HTTP::host]] contains "www.example.com") 
      && ( [string tolower [HTTP::uri]] contains "/") }
 {
 HTTP::redirect https://www.test.com
 }
 }

URI condition is useless as / is in every requests.

try this code

when HTTP_REQUEST {
     if { [string tolower [HTTP::host]] equals "www.example.com"} {
        HTTP::redirect https://www.test.com
     }
 }

many thanks brothers for the response and grate efforts.

many thanks brothers for the response and grate efforts.