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"]]...
hoolio
Cirrostratus
Nov 27, 2006Sorry... the format for string map is:
set my_new_string [string map {$find1 $replace1 $find2 $replace2} $original_string]
You can specify just one pair of find/replace strings if you want.
If you wanted to minimize the steps, you could use something like this:
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" ]
}
}Note that I didn't actually test this, but I think it matches the gist of what you're trying to do.
If you run into problems, try updating the longer version and check the logging in /var/log/ltm to see where it's failing.
Aaron
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