Forum Discussion
Robert_47833
Altostratus
Aug 07, 2011HTTP::header replace Host and HTTP:redirect
Hi,dear irule
1:if there are rule1 and rule2 under one VS,order is rule1 and rule2
rule1:
when HTTP:request {
if { [HTTP::host] euqals "www.srwd18.com"} {
HTTP::redirect "h...
nitass
Employee
Aug 07, 2011so if someone visit www.srwd18.com,client will go to www.google.com or where?
------it can't show the page,I don't know why
sorry i'm wrong. both events are triggered but user gets the first redirection since multiple redirections aren't supported.
[root@tulip:Active] config b virtual bar list
virtual bar {
pool foo
destination 172.28.17.66:http
ip protocol tcp
rules
rule1
rule2
profiles
http
tcp
}
[root@tulip:Active] config b rule rule1 list
rule rule1 {
when HTTP_REQUEST {
log local0.info "rule1"
if {[HTTP::host] equals "www.srwd18.com"} {
HTTP::redirect "http://www.baidu.com"
}
}
}
[root@tulip:Active] config b rule rule2 list
rule rule2 {
when HTTP_REQUEST {
log local0.info "rule2"
if {[HTTP::host] equals "www.srwd18.com"} {
HTTP::redirect "http://www.google.com"
}
}
}
[root@tulip:Active] config curl -i http://www.srwd18.com/
HTTP/1.0 302 Found
Location: http://www.baidu.com
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@tulip:Active] config tail -f /var/log/ltm
Aug 7 05:27:47 tmm tmm[1843]: Rule rule1 : rule1
Aug 7 05:27:47 tmm tmm[1843]: Rule rule2 : rule2
Aug 7 05:27:47 tmm tmm[1843]: 01220001:3: TCL error: rule2 - Operation not supported. Multiple redirect/respond invocations not allowed (line 3) invoked from within "HTTP::redirect "http://www.google.com" "
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