Forum Discussion
Rob_Morhaime_11
Nimbostratus
Aug 20, 2008Simple iRule not working - is it my "string map" syntax?
This seems like a simple iRule, but when applied I get socket errors. Here's the rule:
when HTTP_RESPONSE {
if { [HTTP::is_redirect] }{
if { [HTTP::header Location] contains "PageM...
Nicolas_Menant
Employee
Aug 20, 2008Hi,
This may be due to the quotes. You should check /var/log/ltm for a more detailled message
when HTTP_RESPONSE {
if { [HTTP::is_redirect] }{
if { [HTTP::header "Location"] contains "PageMustBeSecure.htm" }{
HTTP::header replace "Location" [string map -nocase {"http://" "https://"} [HTTP::header "Location"]]
}
}
}
If it doesn't work try this:
when HTTP_RESPONSE {
if { [HTTP::is_redirect] }{
log local0. "is redirect -> [HTTP::header "Location"]"
if { [HTTP::header "Location"] contains "PageMustBeSecure.htm" }{
log local0. "redirect contains PageMustBeSecure.htm "
HTTP::header replace "Location" [string map -nocase {"http://" "https://"} [HTTP::header "Location"]]
log local0. "new redirect is: [HTTP::header "Location"]"
}
}
}
and tell us the output of the /var/log/ltm file
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
