Forum Discussion
Kiran_Kumar
Nimbostratus
Aug 14, 2013irule to switch uri based of a class file
Hi there,
I am beginner in terms of coding irules. I seek your help in coding an irule. My scenario is I need to switch multiple uris. I kind of know how to do it usinga switch statement. But as part...
uni_87886
Cirrostratus
Aug 14, 2013From a data-group, you don't need to use a switch statement. Below is something I use:
ltm data-group internal url-redirect-class {
records {
/from1 {
data /to1
}
/from2 {
data /to2
}
}
}
ltm rule redirect-rule {
when HTTP_REQUEST {
set path [string tolower [HTTP::path]]
set redirect_url [class match -value -- $path equals url-redirect-class]
if { $redirect_url ne "" } {
HTTP::redirect $redirect_url
return
}
}
}
- Kiran_KumarAug 22, 2013
Nimbostratus
Thanks very much Uni
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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