Forum Discussion
Jeff_46763
Sep 11, 2012Nimbostratus
Redirect Irule for wildcard URL's
Hi all, Im working on creating an Irule for a URL that I want anything that ends in .dmz.com and .com to go to a certain URL. I attemped doing a .*, but that didn't work so well. Here's what I have i...
hooleylist
Sep 11, 2012Cirrostratus
Here are a couple of options:
when HTTP_REQUEST {
log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::method] to [HTTP::host][HTTP::uri]"
if {[string tolower [HTTP::host]] starts_with "abbott."} {
HTTP::redirect "http://abbottace-d.com[HTTP::uri]"
log local0. "[IP::client_addr]:[TCP::client_port]: Redirecting to http://abbottace-d.com[HTTP::uri]"
}
}
Or
when HTTP_REQUEST {
log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::method] to [HTTP::host][HTTP::uri]"
switch -glob [string tolower [HTTP::host]] {
"abbott.*" -
"*.lb-devdmz.abbott.com" {
log local0. "[IP::client_addr]:[TCP::client_port]: Redirecting to http://abbottace-d.com[HTTP::uri]"
HTTP::redirect "http://abbottace-d.com[HTTP::uri]"
}
}
}
Aaron
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