Forum Discussion
ckelly45_366132
Nimbostratus
Jul 05, 2018iRule that routes multiple URLS to a single URL
Hi Experts
I have the following URLS from an old ECM system
\access AND
\access
Post upgrade the application has been changed such that the \access is now \content.
Routing at the...
Lee_Sutcliffe
Nacreous
Jul 05, 2018There are a few ways you can achieve this, I've supplied a couple. Assuming when you say, 'route them to' you have your pools set up and you need to replace the host header and use the appropriate URI?
This could be one option, put your two FQDNs in a list with the one you want to ultimately use in the first entry.
when HTTP_REQUEST {
set fqdnList {www.host1.com www.host2.com}
if {[lsearch $fqdnList [HTTP::host]] != -1} {
if {([HTTP::uri] equals "/access") || ([HTTP::uri] equals "/")} {
HTTP::host [lindex $fqdnList 0]
HTTP::uri "/content"
}
}
}
This alternative method maybe easier to understand:
when HTTP_REQUEST {
if {([HTTP::host] equals "www.host1.com") || ([HTTP::host] equals "www.host2.com") } {
if {([HTTP::uri] equals "/access") || ([HTTP::uri] equals "/")} {
HTTP::host www.host1.com
HTTP::uri "/content"
}
}
}
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
