Forum Discussion
HK_ONG_37002
Nimbostratus
Apr 30, 2008Any 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
- hoolio
Cirrostratus
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_12Historic F5 AccountThe 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
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects