Forum Discussion
Joe_Erchul_4263
Nimbostratus
May 15, 2012Rewriting host and part of URI, then appending the remainder of the URI
Gang, Trying to create an iRule to bail out my Application people. I need to modify the existing host to be a new host, then modify the "starts_with" portion of the URI, but also append the...
Joe_Erchul_4263
Nimbostratus
May 15, 2012Nathan,
Thanks for the tip. I added the variables as follows, but still no luck. I don't use variable definition much, so could you check my format for the correct syntax?
Thanks.
Joe
when HTTP_REQUEST {
set uri [HTTP::uri]
set header [HTTP::host]
if { (([HTTP::host] equals "Server1") or ([HTTP::host] equals "Server2")) and
([HTTP::uri] starts_with "/ThisURI") } {
HTTP::header replace Host "FinalDestination"
HTTP::uri "/new[string range $uri 8 end]"
}
}
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