Forum Discussion
Ted_Kircos_1126
Nimbostratus
Nov 24, 2006Need help - Before i pull my hair out!!!
Getting the following trying to add the irule below... Im stumped... Anyone see whats wrong or how to fix it?
line 8: [undefined procedure: http://] ["http://" + [HTTP::header "AP_LOCHOST"]]
line 9: [wrong args] [set replace "https://" + [HTTP::header "AP_LOCHOST"];]
when HTTP_RESPONSE {
if { [HTTP::status] starts_with "3" } {
set location [HTTP::header "Location"];
if { $location != "" } {
if {[HTTP::header "AP_NO_SSL_REDIR"] == "" } {
set find ["http://" + [HTTP::header "AP_LOCHOST"]];
set replace "https://" + [HTTP::header "AP_LOCHOST"];
regsub $find $location $replace newlocation ;
HTTP::header replace $location" newlocation;
}
}
return;
}
}
- hoolio
Cirrostratus
Sorry... the format for string map is:when HTTP_RESPONSE { if { [HTTP::status] starts_with "3" and [HTTP::header "Location"] != "" and [HTTP::header "AP_NO_SSL_REDIR"] == ""} { HTTP::header "Location" [string map { [concat "http://"[HTTP::header "AP_LOCHOST"]] [concat "https://"[HTTP::header "AP_LOCHOST"] } HTTP::header "Location" ] } }
- Ted_Kircos_1126
Nimbostratus
i am getting the following in the logs - Chad_Roberts_21
Nimbostratus
I believe hoolio meant for the following to be a format example, not an actual line in your code. - Deb_Allen_18Historic F5 AccountDid you ever get this to work...?
- Andrew_Abplanal
Nimbostratus
I have tried a number of options but I cannot get variables to work in the mapping section.... - Ted_Kircos_1126
Nimbostratus
Here is my working copY! - Andrew_Abplanal
Nimbostratus
Thanks for the last piece of the puzzle.... it was the "list" function that solved my problem. - Deb_Allen_18Historic F5 Accountniiice!
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