Sean_O_Brien_65
Apr 13, 2010Nimbostratus
iRule forward URL to different domain for http and https
We are planning a website cutover to another (new) existing domain, both going through the F5 currently...
This weekend I will change the DNS to point to different VS on F5 and at that point I will be implementing an iRule to change the old url request (such as in peoples bookmarks, etc...) to point to the new url with a different domain.
I created a test VS and pool to test the iRule I have below, and I believe my problem is forwarding both http and https requests with one iRule.
This is what I have now:
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
"domain1.com" { HTTP::redirect "https://domain1.domain2.com"
}
"www.domain1.com" {
HTTP::redirect "https://domain1.domain2.com"
}
}
}
As it stands, when I try to go to my "domain1.com" after updating my hosts file to point to test VS, I get page not found... Also, if I try https://www.domain1.com, I get an SSL error and it stays as domain1.com in the address bar. Thanks for any help!