theizer_91634
Apr 01, 2009Nimbostratus
multiple redirects - newb needs help
ok...trying my hand at iRules
we own domain.com and domain.net
I need my rule to redirect the following:
1. http://domain.com to https://www.domain.com
2. http://domain.net to https://www.domain.com
3. http://[anything].domain.net to https://www.domain.com
4. http://[anything not "www"].domain.com to https://www.domain.com
5. http://www.domain.com/[path] to https://www.domain.com/[path]
Here is what I have so far. I know I am missing a lot and would really appreciate any help you guys can give.
when HTTP_REQUEST {
if {[HTTP::uri] equals {http://domain.com}} {HTTP::redirect https://www.domain.com
}
elseif {[HTTP::request] contains "domain.net"} {HTTP::redirect https://www.domain.com
}
else
{HTTP::redirect https://[HTTP::host][HTTP::uri]}
}