Forum Discussion
HTTP to HTTPS in the response exception
I have an iRule that needs to execute to fix a problem. As usual it has caused another issue with one of our clients. I need it to execute everytime except with the URL is www.waterworldcalifornia.com. See iRule below
iRule in development
when HTTP_REQUEST {
save hostname for use in response
set fqdn_name [HTTP::host]
}
when HTTP_RESPONSE {
if {[HTTP::is_redirect] }{
if {[$fqdn_name contains "waterworldcalifornia.com"]}{
Exit this event from this iRule
return
} else {
if { [HTTP::header Location] starts_with "/" }{
HTTP::header replace Location " Location]"
} else {
HTTP::header replace Location [string map -nocase "http:// https://" [HTTP::header Location]]
}
}
}
}
iRule in production that breaks the redirection to http://www.waterworldcalifornia.com Waterworldcalifornia does not have a HTTPS site.
when HTTP_REQUEST {
save hostname for use in response
set fqdn_name [HTTP::host]
}
when HTTP_RESPONSE {
if { [HTTP::is_redirect] }{
if { [HTTP::header Location] starts_with "/" }{
HTTP::header replace Location " Location]"
} else {
HTTP::header replace Location [string map -nocase "http:// https://" [HTTP::header Location]]
}
}
}
I have tried this many different ways to no resolution. So I will ask the community for help.
- Kevin_StewartEmployeeTry this:
Recent Discussions
Related Content
* 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