Forum Discussion
ppphatak_127926
Nimbostratus
Sep 07, 2005findclass function doesnt work
I have a class called "myclass" having two members.
www.test1.com,www.yahoo.com
www.test2.com,www.msn.com
and wish to run this single rule against it.
redirect to getfiel...
Martin_Machacek
Sep 21, 2005Historic F5 Account
I've not tested with IE. As a matter of fact, the browser is irrelevant. All that matters is that BIG-IP actually generates a response. The response is useless because of invalid Location, which is caused by findclass working slightly differently than as documented. So, with "work" I mean that BIG-IP generates the redirect response. I've assumed that your problem was that the redirect (302) response has not been generated at all.
The solution (i.e., redirect based on matching a class member and parsing out the redirect target) cannot work because findclass will never match a class member that is longer than the string to match (as I've explained and demonstrated earlier).
The only way how to achieve what you want (if I understand your goal correctly) is to use a chain of if-else statements like this:
rule redir-map {
if(http_host == "www.test1.com") {
redirect to "http://www.yahoo.com"
}
else if(http_host == "www.test2.com") {
redirect to "http://www.msn.com"
}
The smart solution using findclass is unfortunately not going to work.
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