iRule to redirect HTTPs to a third party URL
I've tried several of the examples for iRule redirects but I am not having much luck. Basically, when public traffic comes to a VIP on the F5 on port https, I want to be able to read what the original URL was and redirect it to a third party URL out on the internet. Preferrably, I would like the clients URL to change from our site to the external sites URL. (see iRule below)
I set up a VIP (HTTPS) and am using a defalt client ssl and server ssl profiles. In my iRule (that I borrowed and modified from devcentral) I look from traffic with a HTTP_REQUEST that contains our URL and redirect https to our link on surveymonkey.
Ultimately we might have multiple surveys and so I would like to use this same iRule on the same VIP so that no matter what the client types, I can redirect it to the right place. I tested, with CURL, from the F5 and surveymonkey responds. So, I know I can get there from the F5. But when I try to hit my VIP from a client, I just get the spinning wheel. I do know its looking at the iRule because I am using the tolower command and it converts my text from mixed case to lowercase. However, it never changes the URL in my browser to the surkeymonkey URL that is needed.
when HTTP_REQUEST {
if { (([HTTP::host] contains "myurl.com") or ([HTTP::host] contains "my-url.com")) } {
HTTP::redirect "https://www.surveymonkey.com/oursurvey]"
}
}