Forum Discussion
maximillean_953
Apr 07, 2014Nimbostratus
Example Irule
Hi, I try to translate a content switching rule from netscaler to F5 Irule for migration which still keeps going on.
I need a rule that if first 2 path of uri /cookies/set/xyz
then rule does 302 ...
JRahm
Apr 07, 2014Admin
Give this a try (untested):
when HTTP_REQUEST {
if { [string tolower [HTTP::path]] starts_with "/cookies/set/" } {
set ckname "TESTROUTER"
set ckvalue [getfield [HTTP::path] "/" 3]
set cookie [format "%s=%s; path=/; domain=%s" $ckname $ckvalue ".123.com"]
HTTP::respond 302 Location [HTTP::host] "Set-Cookie" $cookie
}
}
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