Forum Discussion

HK_ONG_37002's avatar
HK_ONG_37002
Icon for Nimbostratus rankNimbostratus
Apr 30, 2008

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,

 

2 Replies

  • 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
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    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