Forum Discussion
Troy_94246
Nimbostratus
Jan 27, 2014Single I-rule with 1000+ URI Redirect
We are working on a Web site refresh and have been asked to use Big IP to redirect over 1000 pages based on URI to a different URI on same page. We have different options to do this with I-rule but I...
Kevin_Stewart
Employee
Jan 27, 2014For that many redirects, I'd HIGHLY recommend a data group list to map to-from information, and then a much smaller iRule.
Example iRule:
when HTTP_REQUEST {
if { [class match [string tolower [HTTP::uri]] starts_with my_uri_dg] } {
HTTP::redirect "http://[HTTP::host][class match -value [string tolower [HTTP::uri]] starts_with my_uri_dg]"
}
}
Example (string-based) data group list:
/aboutus/contactus/index.html := /en/about/contact
/aboutyou/contactme/index.html := /en/about/contactme
/aboutfred/contactfred/index.html := /en/about/contactfred
Also notice that the left side is all lowercase, because you're evaluating a [string tolower ] match in the iRule. In this way you can manage a 1000 line data group list instead of a much larger and much more complicated iRule.
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