HTTP_RESPOND is not triggered for LTM generated responses (like when using HTTP::respond or HTTP::redirect). Also, every URI will start with / so you could either make the URI check more specific or remove it altogether if you want to redirect every request. And ‘return’ exits the current event in the current rule. If you don’t have any more code in the event you don’t need to use return.
That makes more sense. You can use Kirk’s ProxyPass iRule from the codeshare to proxy client requests to another web application. It rewrites the host and/or URIs in request headers and payloads and sends the request to a pool. On responses, instances of the host and URI are again replaced with what the client requested so the client doesn’t see the internal aliases.
If you’re running v9, you should use this version:
ProxyPass (Click here) - iRule to replace the functionality of Apache Webserver ProxyPass and ProxyPassReverse functions
If you’re running v10, you should use this version:
ProxyPass (Click here) - iRule (for TMOS v10) to replace the functionality of Apache Webserver ProxyPass and "“ProxyPassReverse” functions, allowing for a different server and client view of your web site.
It’s a bit of a read, but the instructions are fairly complete on how to use it. If you try something and it’s not working, try enabling debug in RULE_INIT and post the symptoms of the issue and log output from /var/log/ltm.