paulhaskew_7063
Jun 24, 2009Nimbostratus
Rewrite portion of URI?
Hi everyone. First off this forum/website has been invaluable for finding information and answering my questions for quite some time. Wonderful!
So to my question, I have a particular site that we are accessing via http://sub.domain.com/culture/someservice/partners/?qs=*.
The problem I have is that the actual site lives on on http://sub.domain.com/culture/someservice.svc/partners/?qs=*.
The devs would like the flexability to be able to rewrite a portion of the URI dynamically when its requested from multiple cultures. The culture strings could be, en-US, en-GB, nl-NL, etc etc.
Here is the current iRule I wrote to simple just redirect the traffic based on what is contained within the URI, but how to setup the dynamic replace escapes me.
when HTTP_REQUEST {
if {([string tolower [HTTP::uri]] contains "someservice") } {
pool my_secondary_pool
} else {
pool my_first_pool
}
log local0. "Request: [HTTP::uri]"
}
I have looked at the stream command and tried HTTP::header but alas I admit defeat.
Any help would be greatly appricated.