Forum Discussion
Redirect all request except few path
- 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" } } }
Hi,
Have you tried this example yet? https://my.f5.com/manage/s/article/K15117465
You may need to play a little bit with the ones you do/don't want to redirect, but should do the trick.
Alternatively, have you tried creating this under Local Traffic Policies? That will be able to do it as well, and should be a lot quicker to build. (more info: https://techdocs.f5.com/en-us/bigip-15-1-0/big-ip-local-traffic-management-getting-started-with-policies.html)
Hope this helps,
Recent Discussions
Related Content
* 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