Forum Discussion
kraigk_52257
Nimbostratus
Aug 30, 2013Another http redirect question
I've scoured devcentral and google and haven't found my answer. I'm trying to redirect http based on header. A CNAME gets traffic to our VIP as well as straight http that needs to be redirected to h...
Kevin_Stewart
Employee
Aug 30, 2013The first condition does more or less what the default http-to-https code does. Are you using this iRule in addition to another iRule?
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
"mail.domain.com" {
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
}
"exchange.mail.com" {
HTTP::redirect "http://www.domain.com/page.html[HTTP::uri]"
}
}
}Though I might add that the URI "/page.html[HTTP::uri]" doesn't really make sense. If the request URI was "/foo", then you'd redirecting them to "/page.html/foo".
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
