Forum Discussion
Sanal_Babu
Apr 22, 2023Altostratus
Redirect all request except few path
Hi , I am lookin for an irule which should redirect all request to a URL except few based on below path. /en/services/ /en/ajax/logout /en/e-service-errors All the request should redirected to h...
- Apr 23, 2023
Sanal_Babu Assuming the default pool that you would like to forward traffic to is associated to this virtual server the following iRule should do what you are looking for.
when CLIENT_ACCEPTED priority 500 { set DEFAULT_POOL [LB::server pool] } when HTTP_REQUEST priority 500 { set URI [string tolower [HTTP::uri]] switch -- ${URI} { /en/services/ - /en/ajax/logout - /en/e-service-errors { pool ${DEFAULT_POOL} } default { HTTP::redirect "https://stg.bbbb.com" } } }
Paulius
Apr 23, 2023MVP
Sanal_Babu Assuming the default pool that you would like to forward traffic to is associated to this virtual server the following iRule should do what you are looking for.
when CLIENT_ACCEPTED priority 500 {
set DEFAULT_POOL [LB::server pool]
}
when HTTP_REQUEST priority 500 {
set URI [string tolower [HTTP::uri]]
switch -- ${URI} {
/en/services/ -
/en/ajax/logout -
/en/e-service-errors {
pool ${DEFAULT_POOL}
}
default {
HTTP::redirect "https://stg.bbbb.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