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...
youssef1
Cumulonimbus
Jul 05, 2018Hi,
you can try this:
when HTTP_REQUEST {
set hostname [string tolower [HTTP::host]]
if { [HTTP::uri] starts_with "/access/" && [HTTP::host] equals "fqdn2.com" }{
HTTP::uri [string map {/access/ /content/} [HTTP::uri]]
HTTP::header replace Host "fqdn1.com"
} elseif {[HTTP::uri] equals "/access" && [HTTP::host] equals "fqdn1.com" } {
HTTP::uri [string map {/access/ /content/} [HTTP::uri]]
}
}
Add this event if necessary if you want to manage response.
when HTTP_RESPONSE {
if { [HTTP::header is_redirect] && $hostname equals "fqdn1.com"} {
HTTP::header replace Location [string map -nocase "fqdn1.com fqdn2.com" [HTTP::header value Location]]
}
}
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
