Forum Discussion
unRuleY_95363
Feb 02, 2006Historic F5 Account
You could make a wildcard virtual on port 80 and have the iRule generically redirect to the same virtual on https:
virtual generic_http {
destination 0.0.0.0:80
mask 0.0.0.0
ip protocol tcp
profile tcp http
rule generic_redirect
}
rule generic_redirect {
when HTTP_REQUEST {
if { [HTTP::header exists host] }
HTTP::redirect https://[HTTP::host][HTTP::uri]
} else {
HTTP::redirect https://[IP::local_addr][HTTP::uri]
}
}
}
This would allow you to only make the one virtual and rule that generically redirects all http traffic to your https virtuals.