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...
nathe
Cirrocumulus
May 15, 2012Joe
Without my test bed to double check things do look correct. Here's my iRule with a slight amendment to rule out case insensitivities:
when HTTP_REQUEST {
switch [string tolower [HTTP::uri]] {
set uri [HTTP::uri]
if { (([HTTP::host] equals "Server1") or ([HTTP::host] equals "Server2")) and
($uri starts_with "/ThisURI") } {
HTTP::header replace Host "FinalDestination"
HTTP::uri "/new[string range $uri 8 end]"
}
}
}
What happens if you do a curl -i http://Server1/ThisURI/end-up-here.htm -what response do you get back?
N
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