Forum Discussion
Robert_47833
Apr 16, 2012Altostratus
something 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
}
}
else {
pool xxxx
}
http://www.ss.com/cjj doesn't hit pool xxxx,why?
this url doesn't match ".co.uk",why irule doesn't pass it to else?
- hooleylistCirrostratusHi Jucao,
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 xxxx } } else { pool xxxx }
- Robert_47833Altostratusok,I see
- nitassEmployeeyes
[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