Forum Discussion
14 Replies
Sort By
- hooleylist
Cirrostratus
Here are a few examples of rewriting the hostname in redirects: - thethe94_91706
Nimbostratus
. - hooleylist
Cirrostratus
That's not much to work with in terms of a problem statement. - thethe94_91706
Nimbostratus
. - hooleylist
Cirrostratus
If you want to hide the rewriting of the Host header from the client, you'd want to use: - thethe94_91706
Nimbostratus
. - hooleylist
Cirrostratus
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" } }
- thethe94_91706
Nimbostratus
. - hooleylist
Cirrostratus
Yep, so that's why I was rewriting the Host and URI before the request is sent to the pool versus sending a redirect to the client. Have you tried the last iRule I posted? If you did and it didn't work, can you check the logs in /var/log/ltm and reply with details on what didn't work using Fiddler to determine it? - thethe94_91706
Nimbostratus
.