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.0Miles_Raymond_1
Apr 11, 2014Nimbostratus
I'm not sure how this is supposed to work, but it doesn't seem to actually modify the [HTTP::uri] variable as in this example:
when HTTP_REQUEST {
if { [string toupper [HTTP::query]] contains "TRIGGER" } {
if { not ([HTTP::uri] starts_with "/new/dir") } {
HTTP::uri /new/dir[HTTP::uri]
}
HTTP::uri [HTTP::uri]&key=secret
HTTP::redirect http://localhost[HTTP::uri]
}
}
In the above example, I would expect a request for /?TRIGGER to return a redirect to http://localhost/new/dir/?TRIGGER&key=secret but instead, it returns a redirect for /?TRIGGER, clearly not modifying the [HTTP::uri] at all.