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 host [HTTP::host]
set uri [HTTP::uri]
if { [class match -- "http://[string tolower $host$uri]" equals redirection_class] } {
HTTP::redirect [class match -value "http://[string tolower $host$uri]" equals redirection_class]
}
}
}
[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/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
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