Forum Discussion
Sirisha_126707
Mar 07, 2017Nimbostratus
iRule Redirection
This is a redirection rule from https://xyz.co.uk to https://abc.co.uk
But only 1 in 10 requests should redirect initially. Follwing is the iRule I have implemented but it gets redirected even in 20...
Stanislas_Piro2
Mar 07, 2017Cumulonimbus
Hi,
you can try this code (not tested):
when RULE_INIT {
set static::cookie_name "abc-stg" ;
set static::threshold 10 ;
set static_timeout 3600
}
when HTTP_REQUEST {
if {set value [table incr $static::cookie_name $static_timeout] >= $static::threshold} {
table set $static::cookie_name 0 $static_timeout
HTTP::redirect "https://abc.co.uk"
}
}
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