Okay, let me take away the apples and oranges and get to what we're trying to really accomplish.
We're upgrading from an older version of SharePoint to 2013. Now in that process, our SharePoint team decided to change the structure of how things were laid out. I'm trying to come up with a way to change the URI to prevent the thousands of links we have embedded in non-sharepoint pages and other documents from "breaking". All they've done is added a "/dept/" in the structure such as:
OLD Document location: http://share/it/pizzaparty.docx
NEW Document location: http://share13/dept/it/pizzaparty.docx
The conversion is happening one department at a time, so based on the department "IT", I want to change the host from share to share13 (fairly easy) and insert "/dept/" in the front part of the URI(the part I can't get working) without messing with any trailing information in the remaining portion of the URI.
Here is the code I've come up with, but it's not working fully. It works with just http://share/it/ but not with anything trailing the "/it/"
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/it" } {
HTTP::uri [string map -nocase {"/it/" "/dept/it/"} [HTTP::uri]]
HTTP::header replace Host "share13"
pool pool_share13
}
else {
pool pool_share
}
}