Forum Discussion
Michael_Yates
Nov 08, 2011Nimbostratus
Hi Heidi,
All that you should need is the basic default "http" HTTP Profile in order to apply an iRule to a Virtual Server.
The only thing that HTTPS is adding to your issue is that you can only apply one SSL Profile (which contains the SSL Certificate that the client will receive when they connect to the Virtual Server) per Virtual Server, so these two HTTPS Sites will have to be put on separate Virtual Servers to prevent SSL Certificate Mismatch Errors.
I made the assumption that these sites are not identical. Basically that https://www.oldsite.com/foo/bar/itemlist.html would NOT equal https://www.newsite.com/foo/bar/itemlist.html.
If they are, use the 2nd Example:
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] equals "www.oldsite.com" } {
HTTP::respond 301 Location "https://www.newsite.com"
}
}
or
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] equals "www.oldsite.com" } {
HTTP::respond 301 Location "https://www.newsite.com[HTTP::uri]"
}
}
Hope this helps.