how i can erase this post ?
Here are a few examples of rewriting the hostname in redirects:
http://devcentral.f5.com/wiki/default.aspx/iRules/RewriteHTTPRedirectHostname.html
If you get stuck, try using a browser plugin like Fiddler and/or debug logging in the iRule to trace what’s happening versus what you want to happen.
Aaron
.
That’s not much to work with in terms of a problem statement.
What iRule code did you try? What debug logging did you add? What testing did you do? Were you able to install Fiddler and reproduce the issue?
Aaron
.
If you want to hide the rewriting of the Host header from the client, you’d want to use:
HTTP::header replace Host “testctv-intra”
Note that the Host header must not contain the protocol or any part of the URI.
Using HTTP::redirect will trigger LTM sending a 302 redirect to the new location. The change will be displayed in the address bar on the browser.
Do you want to rewrite any request which contains urba so that the host is testctv-intra? When do you want to rewrite the URI to /wiki? Only when the client requests /urba?
Aaron
.
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
.
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?
Aaron
.
.
I don’t have the ability to delete posts. Maybe one of the DC admins can. However, I don’t think there is any sensitive information in the posts, so I wouldn’t worry about it.
Aaron
.
.