Forum Discussion
hooleylist
May 11, 2011Cirrostratus
Can you try this to start with? I assume it won't work completely, but will give you something to test. If it doesn't work, can you check the /var/log/ltm log file for the output? You can use 'tail -f /var/log/ltm' from the command line to watch the log as it's written to.
when HTTP_REQUEST {
log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::method] request to host [HTTP::host] and URI [HTTP::uri]"
Check if the Host is testctv-intra and the URI is /urba
if { [string tolower [HTTP::host]] eq "testctv-intra" and [HTTP::path] eq "/urba"} {
Rewrite the Host header to lurba001
HTTP::header replace Host "lurba001"
Rewrite the URI to /wiki
HTTP::uri "/wiki"
log local0. "[IP::client_addr]:[TCP::client_port]: Rewriting host from testctv-intra to lurba001 and URI from /urba to /wiki"
}
}
when HTTP_RESPONSE {
This event is here for debug logging only
if {[HTTP::is_redirect]}{
log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::status] redirect response with Location [HTTP::header Location]"
} else {
log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::status] response"
}
}
Aaron