Forum Discussion
Robert_47833
Altostratus
Apr 16, 2012something interesting in if {if } else
irule
if {($uri matches "/cjj" or $uri matches "/cjj/") } {
if { [HTTP::host] ends_with ".co.uk" } {
HTTP::redirect "http://[HTTP::host]/error.html"
return
}
}
...
nitass
Employee
Apr 16, 2012yes
[root@ve1023:Active] config b virtual bar list
virtual bar {
snat automap
destination 172.28.19.79:80
ip protocol 6
rules myrule
profiles {
myhttp {}
tcp {}
}
}
[root@ve1023:Active] config b profile myhttp list
profile http myhttp {
fallback "http://www.google.com"
}
[root@ve1023:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
set uri [HTTP::uri]
if {($uri matches "/cjj" or $uri matches "/cjj/") } {
if { [HTTP::host] ends_with ".co.uk" } {
HTTP::redirect "http://[HTTP::host]/error.html"
return
}
} else {
pool foo
}
}
}
[root@ve1023:Active] config curl -I http://www.ss.com/cjj
HTTP/1.0 302 Found
Location: http://www.google.com
Connection: close
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