Forum Discussion
Gill_32697
Nimbostratus
Nov 13, 2012uri limit count
All, I need to expand my URI Redirect. I currently have 8 uri paths defind. The Web Developers want to start migrating more sites, may be between 350 to 400 uri's. Is there a limit how many URI's per...
hoolio
Cirrostratus
Nov 13, 2012Here is an untested example. Define the data group separately and then add the iRule to the virtual server.
v10.x data group mapping old URIs to new URIs
Define this in the GUI under iRules | Data Group List or
by merging this config into your existing config:
class uri_mapping_dg {
{
"/old_uri1" { "/new_uri1" }
"/old_uri2" { "/new_uri2" }
}
}
v11.x data group:
ltm data-group internal uri_mapping_dg {
records {
/old_uri1 {
data /new_uri1
}
/old_uri2 {
data /new_uri2
}
}
}
iRule which looks up the client requested URI to get a match
when HTTP_REQUEST {
log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::method] to [HTTP::host][HTTP::uri]"
Check if URI starts with a URI from the mapping data group
set redirect [class match -value [HTTP::path] starts_with uri_mapping_dg]
if {$redirect eq ""}{
Take some default action for URIs which do not match the data group?
log local0. "[IP::client_addr]:[TCP::client_port]: No match for [HTTP::uri]"
} else {
HTTP::redirect $redirect
log local0. "[IP::client_addr]:[TCP::client_port]: Redirecting to $redirect"
}
}
Aaron
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