Forum Discussion
kouriada_284551
Nimbostratus
Dec 28, 20182 and more irules together
Hi everyone,
I would like to ask if is possible to use this kind of irule for multiple headers Location
when HTTP_RESPONSE {
if { [HTTP::is_redirect] }{
HTTP::header replace Location [string ...
Stanislas_Piro2
Cumulonimbus
Dec 28, 2018you can use this code:
when HTTP_RESPONSE {
if { [HTTP::is_redirect] }{
create an empty list
set rewrite_list [list]
for each valiue in the following list, add in rewrite_list both values http and https
foreach domain [list domainA domainB domainC] {
lappend rewrite_list "http://$domain" "https://$domain"
}
for each value pair in a list, string map replace odd index value with even index value...
HTTP::header replace Location [string map $rewrite_list [HTTP::header Location]]
}
}
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