Forum Discussion
CSA
Nimbostratus
Oct 29, 2012Smartest way to do a class lookup case insensitive
Hi,
Everything is in the title.
I'd like to use class lookup (or a class match -value as it's the same) in a case insenstive way. There isn't any "-nocase" option like in some...
nitass
Employee
Oct 29, 2012e.g.
[root@ve10:Active] config b virtual bar list
virtual bar {
snat automap
pool foo
destination 172.28.19.79:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
set result [lindex [class get -nocase redirection_class "http://[HTTP::host][HTTP::uri]"] 1]
if { $result ne "" } {
HTTP::redirect $result
}
}
}
[root@ve10:Active] config b class redirection_class list
class redirection_class {
"http://www.A.com/B" { "http://www.c.com/d" }
}
[root@ve10:Active] config curl -I http://172.28.19.79/b -H "Host: WWW.a.com"
HTTP/1.0 302 Found
Location: http://www.c.com/d
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve10:Active] config curl -I http://172.28.19.79/somethingelse -H "Host: www.domain.com"
HTTP/1.1 404 Not Found
Date: Tue, 30 Oct 2012 01:55:58 GMT
Server: Apache/2.2.3 (CentOS)
Content-Type: text/html; charset=iso-8859-1
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