Forum Discussion
Alan_Johnson_FB
Jan 29, 2019Nimbostratus
Convert language set iRule to LTM Policy
Hi folks,
Hoping someone can offer some advice on converting an iRule to a LTM Policy. The rule is used to set a cookie which specifies either English or Spanish language on one of our websites. I ...
Rico
Jan 31, 2019Cirrus
Here is an LTM Policy I got working that should fit your needs.
ltm policy set_language {
last-modified 2019-01-31:10:49:10
requires { http }
rules {
set_en {
actions {
0 {
http-set-cookie
response
insert
name i18next
value en
}
1 {
log
response
write
facility local0
message "Set EN Triggered"
priority info
}
}
conditions {
0 {
http-cookie
name i18next
not
values { en }
}
}
}
set_es {
actions {
0 {
http-set-cookie
response
insert
name i18next
value es
}
1 {
log
response
write
facility local0
message "Set ES triggered"
priority info
}
}
conditions {
0 {
http-host
host
contains
values { es.test.company.com }
}
1 {
http-cookie
name i18next
not
values { es }
}
}
ordinal 1
}
}
status published
strategy all-match
}
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