Forum Discussion
How to use iRules to switch between pools?
Actually using Oddah's sugggested code it actually does what I want it to. (Thanks!)
when HTTP_REQUEST { if { [HTTP::uri] contains "/svc/CCEUserMonitor.asp" } { HTTP::respond 301 Location "http://virtual server/svc/cceUserMonitor.asp" } }
If I want to add more contains "blah blah blah.blah" to this how would I code it like after .asp I want to add another if statement.
For example:
when HTTP_REQUEST { if { [HTTP::uri] contains "/svc/CCEUserMonitor.asp" } { HTTP::respond 301 Location "http://virtual server/svc/cceUserMonitor.asp" if { [HTTP::uri] contains "/svc/blahblahblah.asp" } { HTTP::respond 301 Location "http://virtual server/svc/cceUserMonitor.asp" } } }
Can I just add if statement after if statement? Sorry I just have zero programing experience.
Thanks guys!
If you want to redirect anything that starts with /svc:
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/svc/" } {
HTTP::respond 301 Location "http://virtual server/svc/cceUserMonitor.asp"
}
}
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