Forum Discussion
theizer_91634
Nimbostratus
Apr 01, 2009multiple 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. h...
dennypayne
Employee
Apr 01, 2009Hi,
One problem is the domain.com, domain.net, etc is not part of [HTTP::uri], it's the [HTTP::host]. URI is the rest of the URL after the host, so your first check would need to be against [HTTP::host] without the http://.
That said, I think you could just do:
when HTTP_REQUEST {
if { not [HTTP::host] equals "www.domain.com" }{
HTTP::redirect "https://www.domain.com"
} else {
HTTP::redirect "https://www.domain.com/[HTTP::uri]"
}
}
Denny
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
