iRule: modifying the uri without a redirect
In this case the user wants to change the uri of a HTTP request without forcing a redirect from the client.
We have a unique situation where a client-based DLL is uploading a file to our...
Published Jul 27, 2005
Version 1.0Jul 21, 2008
There are two ways to modify the URI.
1) HTTP redirects. This will send a redirect HTTP response to the client with the Location response header containing the new location. The browser will update the address bar with the new location and issue a new request.
2) Transparent header modifications. You can modify the HTTP::uri and HTTP::host values in an iRule without a redirect to the browser. This will make it appear to the server that a different request was made and the browser will not update it's address bar (since a redirect command wasn't made. So, if you want http://www.foo.com/file1.txt to "look like" http://www.bar.com/file2.txt, you can do so with the following iRules code
when HTTP_REQUEST {
if { ([HTTP::host] eq "www.foo.com") && ([HTTP::uri] eq "/file1.txt" } {
HTTP::host "www.bar.com"
HTTP::uri "/file2.txt"
}
}
Hope this helps...
Feel free to post more questions over on the iRules forum if they come up.
-Joe