Forum Discussion
thethe94_91706
Nimbostratus
May 10, 2011redirect and rewriting
how i can erase this post ?
hoolio
Cirrostratus
May 11, 2011Can 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
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects