Forum Discussion
Michael_Yates
Jun 03, 2011Nimbostratus
I tested a slightly modified version of your iRule and it worked fine for me. I think that the 404 that you are getting is an indication that it is working for you as well, but it is not finding the content that you are requesting from the server.
If you are concerned about the actual functionality of the iRule I would suggest doing something like this so that you can narrow down where your issue is. If the redirect work then you know that that portion of your logic is correct and that you need to investigate the server configuration in the pools that you are directing the traffic to, or the content on the server:
when HTTP_REQUEST {
log local0. "McBob request received"
if { [string tolower [HTTP::path]] starts_with "/mcbob" } {
log local0. "McBob request for service received. Selecting end server"
pool secure2.mydomain.com
HTTP::redirect "http://www.google.com"
}
else {
log local0. "Condition not matched. No WIN2K8 server selected."
pool secure.mydomain.com
HTTP::redirect "http://www.yahoo.com"
}
}
when SERVER_CONNECTED {
log local0. "Connection from [IP::client_addr]:[TCP::client_port] to WIN2K8 server: [IP::server_addr]:[TCP::server_port] established."
}