Forum Discussion
Tom_Thunem_9204
Nimbostratus
Jul 24, 2013large number of redirects
our application group has 142 redirects they want added to into an iRule. i was wondering what the most effiecient method might be. i am currently using this syntax for many of our redirects and he...
Kevin_Stewart
Employee
Jul 24, 2013Sure.
Step 1: create a data group (LTM GUI: iRule | Data Group List | Create). Enter a name (example "my_test_dg"), select "String" type, and start entering strings and values. Example:
"/something-else" := "http://our-domain.com/some/other/URI/values"
"/something" := "http://our-domain.com/some/URI/values"
"/and-so-on" := "http://our-domain.com/and/so/on"
** I would order these from most to least specific if the URIs start with the same string values.
Step 2: Create the iRule:
when HTTP_REQUEST {
if { [class match [string tolower [HTTP::uri]] starts_with my_test_dg] } {
HTTP::redirect [class match -value [string tolower [HTTP::uri]] starts_with my_test_dg]
}
}
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