Any ideas for [HTTP::path] eq "/"

Hi,

What is the function for [HTTP::path] eq “/”. If below iRule without [HTTP::path] eq “/” internet browser display status code 302.

when HTTP_REQUEST {

if { ([HTTP::host] equals “abc.domain.test.com”) and ([HTTP::path] eq “/”)} {

HTTP::redirect http://[HTTP::host]/snoop

} elseif {([HTTP::host] equals “xyz.domain.test.com”) and ([HTTP::path] eq “/”)} {

HTTP::redirect http://[HTTP::host]/hello

}

}

Any ideas would be greatly appreciated.

Regards,

Hello,

The iRule you have listed will check if the host matches abc.domain.test.com and the path (URI without the query string) is the root object (/). If so, a 302 redirect to the same host and a URI of /snoop will be sent.

Are you wanting to change the rule, or just understand what it’s doing?

Aaron

The rule will only perform the desired redirects if the path equals “/”. If you have something else in the URI following the domain, it won’t redirect. Perhaps that’s the confusion you’re having?

Colin